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?
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.
Example 1
Public Function IsMidnight(ByVal value As Date) As Boolean
Return value.TimeOfDay = TimeSpan.FromHours(0)
End Function
Example 2
Public Function IsMidnight(ByVal value As Date) As Boolean
Return value.CompareTo(value.[Date]) = 0
End Function