title: How to check for default DateTime value?
body: <p>I need to check a <code>DateTime</code> value if it has a value or not.</p>
  
  <p>I have several options:</p>
  
  <pre><code>if (dateTime == default(DateTime))
  </code></pre>
  
  <p>or</p>
  
  <pre><code>if (dateTime == DateTime.MinValue)
  </code></pre>
  
  <p>or using a nullable <code>DateTime?</code></p>
  
  <pre><code>if (nullableDateTime.HasValue)
  </code></pre>
  
  <p>Personally I would prefer the third version, since its pretty good readable.
  But in our database we have some datetime columns which are defined as not null.
  So in some cases I have to go with the first two options.</p>
  
  <p>I read somewhere that the <code>default</code> keyword should be used when working with generics, but isn't it much more readable in this case? When using the second option I have to know that the default value of a new and empty DateTime instance is DateTime.MinValue which has the smell of an implementation detail for me.</p>
  
  <p>So which option should I use to use "best practice"?</p>