Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

Time conversions from EST with daylight saving to GMT

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil Johnson - 29 Jan 2008 18:13 GMT
Hi,

I have a web application that will be hosted on servers with timezones
configured to EST with daylight saving.

My application takes an XML datafeed that contains times in GMT (also with
daylight saving that will change on different dates to EST)

Is there any way within the .net framework to convert the current time from
the server (which will be EST with daylight saving) to GMT?

If not in the .net framework, is there any other way to do it?  I'm
considering having a configuration setting that the site owner can log on to
the site and change the time difference, but would prefer to have an
automated solution.

Signature

Regards,

Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com

Cowboy (Gregory A. Beamer) - 29 Jan 2008 18:55 GMT
It is an easy offset. This time of year, it is 5 hours off. During the
summer, you move ahead one hour, which makes it four hours.

There are some methods on the DateTime structure you should look at:

ToLocalTime() - This is probably the most useful for you
http://msdn2.microsoft.com/en-us/library/system.datetime.tolocaltime.aspx

ToUniversalTime() - opposite direction
http://msdn2.microsoft.com/en-us/library/system.datetime.tolocaltime.aspx

Signature

Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************

| Think outside the box!

*************************************************
> Hi,
>
[quoted text clipped - 13 lines]
> the site and change the time difference, but would prefer to have an
> automated solution.
Phil Johnson - 29 Jan 2008 19:32 GMT
Thanks George,

Looks ideal, I will give it a go.

Signature

Regards,

Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com

> It is an easy offset. This time of year, it is 5 hours off. During the
> summer, you move ahead one hour, which makes it four hours.
[quoted text clipped - 27 lines]
> > the site and change the time difference, but would prefer to have an
> > automated solution.
Phil Johnson - 04 Feb 2008 13:38 GMT
The link given above really got me started on the timezone conversion issue,
but I also had some hurdles to overcome when comparing javascript utc
datetime from the client to the .NET utc date time on the server.

Here is how I got around the issues....

http://pjsoftwaredeveloper.blogspot.com/2008/02/comparing-net-date-on-server-to-
clients.html


Signature

Regards,

Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com

> Thanks George,
>
[quoted text clipped - 31 lines]
> > > the site and change the time difference, but would prefer to have an
> > > automated solution.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.