title: C# DateTime: What "date" to use when I'm using just the "time"?
body: <p>I'm using a <code>DateTime</code> in C# to display times. What date portion does everyone use when constructing a time?</p>
  
  <p>E.g. the following is not valid because there is no zero-th month or zero-th day:</p>
  
  <pre><code>// 4:37:58 PM
  DateTime time = new DateTime(0, 0, 0, 16, 47, 58);
  </code></pre>
  
  <p>Do I use COM's zero date?</p>
  
  <pre><code>// 4:37:58 PM
  DateTime time = new DateTime(1899, 12, 30, 16, 47, 58);
  </code></pre>
  
  <p>Or perhaps SQL Server's?</p>
  
  <pre><code>//4:37:58 PM
  DateTime time = new DateTime(1900, 1, 1, 16, 47, 58);
  </code></pre>
  
  <p>I realize it's arbitrary, since I'll be ignoring the date portions in code, but it would still be nice to be able to use:</p>
  
  <pre><code>DateTime duration = time2 - time1;
  </code></pre>
  
  <hr>
  
  <h1>Answer</h1>
  
  <p>I think I like <strong>MinValue</strong></p>
  
  <pre><code> DateTime time = DateTime.MinValue.Date.Add(new TimeSpan(16, 47, 58));
  </code></pre>
  
  <hr>
  
  <p><strong>Note:</strong> I can't use a <code>TimeSpan</code>, because that doesn't store times of the day. And the reason I know that is because there's no way to display its contents as a time.</p>
  
  <p>Which is to say that <code>TimeSpan</code> records a <em>span of time</em>, not a <em>time of day</em>, e.g.:</p>
  
  <pre><code>TimeSpan t = new TimeSpan(16, 47, 58);
  t.ToString();
  </code></pre>
  
  <p>returns a span of time in the format <em>hours</em>:<em>minutes</em>:<em>seconds</em>, e.g.:</p>
  
  <pre><code>16:47:58
  </code></pre>
  
  <p>rather than a time:</p>
  
  <pre><code>4:47:58 PM    (United States)
  04:47:58 nm   (South Africa)
  4:47:58.MD    (Albania)
  16:47:58      (Algeria)
  04:47:58 م    (Bahrain)
  PM 4:47:58    (Singapore)
  下午 04:47:58  (Taiwan)
  04:47:58 PM   (Belize)
  4:47:58 p.m.  (New Zealand)
  4:47:58 μμ    (Greece)
  16.47.58      (Italy)
  오후 4:47:58   (Korea)
  04:47:58 ب.ظ  (Iran)
  ਸ਼ਾਮ 04:47:58   (India)
  04:47:58 p.m. (Argentina)
  etc
  </code></pre>
  
  <p>In other words, there is a difference between a timespan, and a time. And also realize that <code>TimeSpan</code> doesn't provide a mechanism to convert a span of time into a time of day - and there is a reason for that.</p>