title: Deserialize DateTime? Json
body: <p>I have a list which contains elements of class type which contains a property </p>
  
  <pre><code>[DataMember]
  public DateTime? DateOfBirth { get; set; }
  </code></pre>
  
  <p>im serializing the whole list to a file like so:</p>
  
  <pre><code>    JsonSerializer serializer = new JsonSerializer();
      serializer.Converters.Add(new JavaScriptDateTimeConverter());
      serializer.NullValueHandling = NullValueHandling.Ignore;
  
      using (StreamWriter sw = new StreamWriter(@"c:\json.txt"))
      using (JsonWriter writer = new JsonTextWriter(sw))
      {
          serializer.Serialize(writer, _myList);
      }
  </code></pre>
  
  <p>and when i try to deserialize like so:</p>
  
  <pre><code>    JsonSerializer serializer = new JsonSerializer();
      serializer.Converters.Add(new JavaScriptDateTimeConverter());
      string text = System.IO.File.ReadAllText(@"c:\json.txt");
  
      _myList = JsonConvert.DeserializeObject&lt;List&lt;UserInformation&gt;&gt;(text);
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <p>Error setting value to 'DateOfBirth' on 'Namespace'.</p>
  
  <ul>
  <li>EDIT -</li>
  </ul>
  
  <p>Json Looks like: "DateOfBirth":new Date(-1459735200000) (i couldn't find how it looks when DateOfBirth == null)</p>
  
  <p>I'm a beginner using Json, and im having difficulty understanding it as it is, can someone explain to me what is the problem and how do i fix this?</p>
  
  <p>Thanks in advance</p>