Even more on DateTime...

I thought I’d promote some of the discussion from a recent blog entry to the main feed as others may find it interesting… As Mark Treadwell says, it is a complicated subject. 

Comment (Markus Reiner):

Hello,
we have also problems with DateTime because of using local time. IMHO DateTime should internally use always UTC. Only Parse() and ToString() (the methods converting it for interacting with a user who lives always relativ to local time) should ask the OS and convert it if needed.
If someone persists a DateTime instance (to a file, to registry and so on) you will always get in trouble! Don't look only at serialization!
It would be very helpful if we could have a patch for .NET 1.1.

Response (Anthony Moore)

Markus, thanks very much for the feedback. I have been working on some FAQ entries to answer these questions, which for now I have posed on the BCL Blog:

https://weblogs.asp.net/bclteam/archive/2004/05/21/136918.aspx

In short, it is not practical to make a change as substantial as you are recommending to DateTime, either in servicing or in future releases. Believe me, the options have been thoroughly explored, but it is not possible to get acceptable compatibility in terms of both functionality or performance. The first FAQ entry goes into the detail on this issue.

However, it is possible to serialize DateTime without getting into trouble, so two of the FAQ entries are devoted to recommended ways to serialize DateTime in Binary and Text.

Thanks very much for your response and I hope this is helpful.