What do you use to create a date? If you build this XML in your code rather than using any serializer (WCF or XmlSerializer), you can use System.Xml.XmlConvert to generate and interpret the date as follows:
To create a string placed in XML:
DateTime startDate = DateTime.Now; string startDateString = System.Xml.XmlConvert.ToString(startDate);
To get a date from XML:
DateTime startDateFromXml = System.Xml.XmlConvert.ToDateTime(startDateString);
If you start with two DateTime instances that differ by 37 minutes and 54 seconds before you paste them into XML, they will still differ by 37 minutes and 54 seconds after you pull them out of XML.
Dan finucane
source share