title: Equivalent of __DATE__, __TIME__ macros in C#
body: <p>Is there an equivalent of <code>__DATE__</code> and <code>__TIME__</code> in C#? </p>
  
  <p>Basically what I'm trying to do is place some build timestamping in a C# application.</p>
  
  <p><a href="http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/b55e0fa8-09c6-4692-850a-4c3f7c30f218" rel="noreferrer">One possibility</a> I saw on Microsoft's website was to do the following:</p>
  
  <pre><code>Assembly assem = Assembly.GetExecutingAssembly();
  Version vers = assem.GetName().Version;
  DateTime buildDate = new DateTime(2000, 1, 1).AddDays(vers.Build).AddSeconds(vers.Revision * 2);
  Console.WriteLine(vers.ToString());
  Console.WriteLine(buildDate.ToString());
  </code></pre>
  
  <p>However, this only works if your version in AssemblyInfo.cs is "1.0.<em>.</em>", which ours won't be.</p>