October 31st, 2008

Working with ambiguous and invalid points in time in managed code

Public Service Announcement: Daylight Saving Time ends in most parts of the United States this weekend.

I pointed out some time ago that Win32 and .NET deal with daylight saving time differently. Specifically, Win32 always deals with the time zone you are currently in (even if it’s not the time zone that corresponds to the timestamp you are manipulating), whereas .NET deals with the time zone that was in effect at the time the timestamp was generated.

For more details on the latter, I refer you to Josh Free from the BCL Team Blog, who some time ago explained how to work with ambiguous and invalid points in time in managed code.

Topics
CodeTime

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.