title: convert C# date time to string and back
body: <p>I'm converting C# date time to string. Later when I convert it back to <strong>DateTime</strong> object it appears that they are not equal.</p>
  
  <pre><code>const string FMT = "yyyy-MM-dd HH:mm:ss.fff";
  DateTime now1 = DateTime.Now;
  string strDate = now1.ToString(FMT);
  DateTime now2 = DateTime.ParseExact(strDate, FMT, CultureInfo.InvariantCulture);
  Console.WriteLine(now1.ToBinary());
  Console.WriteLine(now2.ToBinary());
  </code></pre>
  
  <p>Here is the example. Looks like everything is included in string format, when I print date both displays the same, but when I compare objects or print date in binary format I see the difference. It looks strange to me, could you please explain what is going on here?</p>
  
  <p>Here is the output for the code above.</p>
  
  <pre><code>-8588633131198276118
  634739049656490000
  </code></pre>