title: Custom DateTime format string not working as expected
body: <p>I have a custom <code>DateTime</code> format string: <code>"M/d/yyyy h:m:ss tt"</code>.</p>
  
  <p>For example, with the date 'September 18th, 2012 @ noon', I expect the output of this to be something like <code>"9/18/2012 12:0:00 PM"</code>.</p>
  
  <p>The time seems to be formatting properly, but the date portion is getting messed up. I am seeing the dates formatted as <code>"MM-dd-yyyy"</code> and I can't figure out why.</p>
  
  <p>Here is some sample code to reproduce the problem:</p>
  
  <pre><code>var datetime = DateTime.Now;
  Console.WriteLine("Date: " + datetime.ToString("MMMM d, yyyy"));       // Date: October 11, 2012 --&gt; correct
  Console.WriteLine("Date: " + datetime.ToString("M/d/yyyy h:m:ss tt")); // Date: 10-11-2012 4:34:17 PM --&gt; wrong
  </code></pre>
  
  <p>Here is the <a href="http://msdn.microsoft.com/en-us/library/8kb3ddd4%28v=vs.100%29.aspx">MSDN doc for custom DateTime format strings</a>.</p>
  
  <p>Any ideas on what am I doing wrong? How can I achieve my desired result?</p>
  
  <p><strong>Edit:</strong><br>
  The thing that is incorrect in the last line of sample code is that there is hyphens instead of slashes and I don't know why.</p>
  
  <p>Also, my computer's language is set to English (Canada). But neither my "short" nor "long" date format look like <code>M-d-yyyy</code> so I have no idea where that is coming from.</p>