I have an XML document I'm deserializing using XmlSerializer
. The other properties on the document work just fine, but there is one element in particular that isn't working:
<StartDate>2014-03-21T00:00:00</StartDate>
This is defined in C# in a POCO as:
[XmlElement("StartDate")]
private DateTime StartDate { get; set; }
When I deserialize the document, StartDate
is 01/01/0001 12:00:00 AM
. I thought the standard XML date/time format was YYYY-MM-DDTHH:MM:SS
? So why is this not deserializing correctly?
Note: I do not have control over the XML document I'm deserializing. It's coming from a third-party system.