title: How to extract just the date from a DateTimeOffsetDateTimeOffset object
body: <p>How to extract just the date from a <strong>DateTimeOffsetDateTimeOffset</strong> object? I thought the <strong>Date</strong> property would return just the date part. But, I keep getting the whole date, i.e. <strong>7/17/2014 12:00:00 AM -04:00</strong>. I'd like to get only the date portion <strong>7/17/2014</strong>.</p>
  
  <p>Here's my code.</p>
  
  <pre><code>Func&lt;DataRow, string, DateTimeOffset?&gt; getFieldNullableDate = (row, field) =&gt;
  {
    if (!string.IsNullOrWhiteSpace((row[field] ?? string.Empty).ToString()))
        return DateTimeOffset.Parse(row[field].ToString()).Date;
    else
        return null;
  };
  </code></pre>
  
  <p>Thanks for helping. </p>