title: Milliseconds in my DateTime changes when stored in SQL Server
body: <p>I have a date time that I generate like this:</p>
  
  <pre><code>DateTime myDateTime = DateTime.Now;
  </code></pre>
  
  <p>I then store it in the database (in a <code>DateTime</code> typed column) with Entity Framework.  I then retrieve it with OData (WCF Data Services).</p>
  
  <p>When it goes in the TimeOfDay value is: <strong>09:30:03.0196095</strong></p>
  
  <p>When it comes out the TimeOfDay value is: <strong>09:30:03.0200000</strong></p>
  
  <p>The net effect of this makes it so that the Milliseconds are seen as 19 before it is saved and 20 after it is re-loaded.</p>
  
  <p>So when I do a compare later in my code, it fails where it should be equal.</p>
  
  <p>Does SQL Server not have as much precision as .NET?  Or is it Entity Framework or OData that is messing this up?</p>
  
  <p>I will just truncate off the milliseconds (I don't really need them).  But I would like to know why this is happening.</p>