title: Custom DateTime serialization/deserialization using DataContractJsonSerializer
body: <p>How to change the default JSON <code>DateTime</code> serialization/deserialization to a custom format using <code>DataContractJsonSerializer</code> for all <code>DateTime</code> properties in the object graph?</p>
  
  <p>The Json.Net library deals with this but I can't use that in this project.</p>
  
  <p>I tried <code>IDataContractSurrogate</code>but I cannot access the value -> string conversion for DateTimes.</p>
  
  <p>The model and expected JSON are:</p>
  
  <pre><code>[DataContract]
  public class Client
  {
      [DataMember(Name = "id")]
      public int Id {get; set; }
      [DataMember(Name = "name")]
      public string Name {get; set; }
      [DataMember(Name = "contacts")]
      public IList&lt;Contact&gt; Contacts {get; set; }
      [DataMember(Name = "created")]
      public DateTime Created {get; set; }
      [DataMember(Name = "changed")]
      public DateTime Changed {get; set; }
  }
  
  [DataContract]
  public class Contact
  {
      [DataMember(Name = "name")]
      public string Name {get; set; }
      [DataMember(Name = "created")]
      public DateTime Created {get; set; }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>{
      "id": 123,
      "name": "Client Name",
      "contacts": [
          {
              "name": "Contact Name",
              "created": "2014-01-25 02:12:43"
          }
      ],
      "created": "2014-01-25 01:11:23"
      "changed": "2014-01-25 03:22:41"
  }
  </code></pre>