August 20, 2003
@ 01:43 PM

While I wasn't looking, Doug Purdy, who is the PM for the team in charge of the XmlSerializer has posted this little cryptic answer to my initial question:

String serializedDateTime = XmlConvert.ToString( someDateTime );

DateTime deserializedDateTime = XmlConvert.ToDateTime( serializedDateTime );

What Doug is showing is really what the serializer is doing with dates under the hood and that I am incorrectly blaming the XmlSerializer for the lack of UTC support. [XmlConvert.ToString() also does nothing more than calling DateTime.ToString() with the appropriate format string]. As I was already saying in yesterday's post, but what I want to make a bit clearer here again is that the actual problem is the lack of time-zone awareness in DateTime.

So the proper thing more me to do is to ask the base-class library team for time-zone support in the base-class library for Whidbey so that Doug can fix this for us ;)

Categories: XML | CLR

Wednesday, August 20, 2003 10:44:55 PM UTC
Going further, we don't just need DateTime to support the existing TimeZone in the framework - we need it to support a more flexible TimeZone library like that created by Michael Brumm, so that we can parse, process, convert, and serialize dates and times to and from a whole range of time zones including not just the local time zone and UTC but also any arbitrary time zone that can be defined (or accessed from the system's time zone information).
Jeremy Gray
Wednesday, August 20, 2003 10:49:58 PM UTC
With all of the various daylight savings time and Win32 time zone database features of the afore-mentioned library, of course. :)
Jeremy Gray
Comments are closed.