Partilhar via


New DateTime Best Practices Article

[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:

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

Thanks Dan.

Comments

  • Anonymous
    January 25, 2004
    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?
  • Anonymous
    March 15, 2004
    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