When I XML serialize my DateTime field (which has a value from datepicker), the date is always serialized as
0001-01-01T00: 00: 00
i.e. January 1, 1AD. Why is this? Also, when I try to deserialize XML, I get this error:
startIndex cannot be greater than the length of the string.
Parameter Name: startIndex.
However, when I edit the XML manually, deserialization has been going fine for 1000 - 9999 years, but not for years <1000?
The DateTime property has [XmlElement] , like all other fields that are correctly serialized, and the rest of the code looks fine. Thanks in advance!
source
share