What exactly doesn't it understand and what version of the .NET Framwork?

I live in GMT-5 and we are under daylight savings time which makes it GMT-4. The example code below set the dtUTC to 11pm and the ToLocalTime method correctly return 7pm (which is -4 hours).

I haven't done much with timezones other than always trying to save as UTC and then converting to localtime. What gotchas should I be looking out for?

-----Original Message-----
From: James Chapman-Smith
Sent: 8/28/2011 11:09 PM
I'd be careful using `DateTime` - it doesn't understand the timezone inherently.

Try using the new (to 4.0) `DateTimeOffset` which does. It picks up its TZ info 
from the repository so I suspect that it is going to be as good as the Olson 
DB. I don't know where MS gets their updates from, but I'm sure it's pretty 
much up-to-date.

-----Original Message-----
From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On 
Behalf Of Al Gonzalez
Sent: Monday, 29 August 2011 07:44
To: ozDotNet
Subject: Re: timezone converasion and olson database

Is this what you are trying to do?

      DateTime dtUTC = new DateTime(2011, 8, 28, 23, 0, 0);

      DateTime dtLocal = dtUTC.ToLocalTime();



-----Original Message-----
From: Anthony Mayan
Sent: 8/28/2011 8:58 AM
Anyone have experience with converting time from utc to localtime.
It appears that olson database is a standard but i cannot find any
.net code to use it!

Does dotnet have this functionaility?

Anthony






Reply via email to