New DateTime Best Practices Article

New DateTime Best Practices Article

  • Comments 2

[Anthony Moore]

A colleage of mine from another team, Dan Rogers, has written an excellent article on the best way to use the DateTime class, and to deal with problems like time zones and Daylight Savings Time. He has let us post it on our site:

http://www.gotdotnet.com/team/clr/bcl/TechArticles/techarticles/datetimeguidelines.doc

Thanks Dan.

  • Well, given that the TimeZone class does not seem to have methods to convert to anything else than the current timezone, it is pretty useless for anything else than converting from/to UTC (which by the way is misspelt at about every occation in the article), making the suggestion to store local time + an indicator of the timezone pretty strange. The only way appears to be writing the date as a string including the timezone information and then parsing it back in. Is this an armchair-couch "Best Practice", or has anyone actually built working data models using these recommendations?
  • I was wondering if anyone had some background on the decision to make DateTime a structure. I blogged on a couple of problems I have had with this decision.

    http://dotnetjunkies.com/WebLog/scottmunro/archive/2004/03/15/9153.aspx
Page 1 of 1 (2 items)