Q:

TimeZoneInfo and Daylight Saving

I use TimeZoneInfo.ConvertTime method to convert from source TimeZone to Destination TimeZone. This works fine for me. I want to know, if Daylight Savings has been changed for the Destination TimeZone will it be handled automatically in .Net 4.0.
Below is the Code i used for conversion.
TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.Local, timeZoneInfo)

A:

Yes, TimeZoneInfo.ConvertTime handles daylight saving time, as best it can.
However, note that if you're using a DateTime with a kind of "unspecified" (e.g. having parsed it from a string) that may be ambiguous in your source time zone. (For example, if the clocks go back from 2am to 1am, then 1.30am happens twice on that day.) It shouldn't be a problem for DateTime.Now, as the "local" kind can actually be "local and the earlier of ambiguous times" or "local and the later of ambiguous times".
If you want to take more control of the conversions - as well as having more descriptive types - you might want to have a look at my Noda Time library.

