title: Converting DateTime to unix timestamp and back again - result is not equal
body: <p>I recently started learning C# and ran into a bug, I tracked it down and discovered it was because if I convert a <code>DateTime</code> object to a timestamp, then back to a <code>DateTime</code> object, the resulting <code>DateTime</code> doesn't equal the original one, even though to me they seem identical.</p>
  
  <p>I put together a snippet to exhibit what I mean</p>
  
  <pre><code>void Main()
  {
      DateTime ePoch = new DateTime(1970, 1, 1, 0, 0, 0);
  
      DateTime dateTime = DateTime.UtcNow;
      TimeSpan timeSpan = (dateTime.ToUniversalTime() - ePoch);
      double unixTimeStamp = timeSpan.TotalSeconds;
  
      DateTime dateTimeConvertedBack = ePoch.AddSeconds(unixTimeStamp);
  
      System.Console.WriteLine(dateTime);
      System.Console.WriteLine(dateTimeConvertedBack);
      System.Console.WriteLine(dateTime.Millisecond);
      System.Console.WriteLine(dateTimeConvertedBack.Millisecond);
      System.Console.WriteLine(dateTime == dateTimeConvertedBack);  //results in false??
  }
  </code></pre>
  
  <p>Which prints:</p>
  
  <pre><code>12/08/2013 15:43:56
  12/08/2013 15:43:56
  977
  977
  False
  </code></pre>
  
  <p>Why aren't these two objects treated as equal?</p>
  
  <p>I'm pretty certain an <code>==</code> test on <code>DateTime</code> should compare values and not the refs.</p>