title: How do I serialize DateTime properly?
body: <p>When I XML-serialize my DateTime field (which has the value from a datepicker), the date is always serialized as</p>
  
  <p><strong>0001-01-01T00:00:00</strong></p>
  
  <p>i.e. 1st January 1AD. Why is this? Also, when I try to <em>deserialize</em> the XML, I get this error:</p>
  
  <p><strong>startIndex cannot be larger than length of string.</strong><br>
  <strong>Parameter name: startIndex.</strong></p>
  
  <p>However, when I edit the XML manually, deserialization goes just fine for years 1000-9999, but not for years &lt;1000 ?</p>
  
  <p>The DateTime property has the <strong>[XmlElement]</strong>, just like all other fields that get serialized properly, and the rest of the code appears to be ok. Thanks in advance!</p>