title: What is the best way to determine if a System.DateTime is midnight?
body: <p>It seems that there are several possible ways to determine if a given System.DateTime represents midnight. What are the pros and cons of each? Is one more readable or perform better than the others?</p>
  
  <p>EDIT: I believe that readability is more important than performance until profiling shows that there is an issue. That is why I asked about both.</p>
  
  <p>Example 1</p>
  
  <pre><code>Public Function IsMidnight(ByVal value As Date) As Boolean
      Return value.TimeOfDay = TimeSpan.FromHours(0)
  End Function
  </code></pre>
  
  <p>Example 2</p>
  
  <pre><code>Public Function IsMidnight(ByVal value As Date) As Boolean
      Return value.CompareTo(value.[Date]) = 0
  End Function
  </code></pre>