<p>How do I get today's date in C# in mm/dd/yyyy format?</p>

<p>I need to set a string variable to today's date (preferably without the year), but there's got to be a better way than building it month-/-day one piece at a time.</p>

<p>BTW: I'm in the US so M/dd would be correct, e.g. September 11th is 9/11.</p>

<p><em>Note: an answer from kronoz came in that discussed internationalization, and I thought it was awesome enough to mention since I can't make it an 'accepted' answer as well.</em></p>

<p><a href="https://stackoverflow.com/questions/32747/how-do-i-get-todays-date-in-c-in-8282008-format#32819" title="kronoz&#39;s answer">kronoz's answer</a></p>

[{'answer_id': 32749, 'author': 'Joel Coehoorn', 'author_id': 3043, 'author_profile': 'https://Stackoverflow.com/users/3043', 'pm_score': 9, 'selected': True, 'text': '<pre><code>DateTime.Now.ToString("M/d/yyyy");\n</code></pre>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx</a></p>\n'}, {'answer_id': 32751, 'author': 'Corin Blaikie', 'author_id': 1736, 'author_profile': 'https://Stackoverflow.com/users/1736', 'pm_score': 4, 'selected': False, 'text': '<pre><code>DateTime.Now.ToString("dd/MM/yyyy");\n</code></pre>\n'}, {'answer_id': 32752, 'author': 'Josh Mein', 'author_id': 2486, 'author_profile': 'https://Stackoverflow.com/users/2486', 'pm_score': 3, 'selected': False, 'text': '<pre><code>DateTime.Now.Date.ToShortDateString()\n</code></pre>\n\n<p>I think this is what you are looking for</p>\n'}, {'answer_id': 32758, 'author': 'Corin Blaikie', 'author_id': 1736, 'author_profile': 'https://Stackoverflow.com/users/1736', 'pm_score': 3, 'selected': False, 'text': '<pre><code>DateTime.Now.Date.ToShortDateString()\n</code></pre>\n\n<p>is culture specific. </p>\n\n<p>It is best to stick with:</p>\n\n<pre><code>DateTime.Now.ToString("d/MM/yyyy");\n</code></pre>\n'}, {'answer_id': 32759, 'author': 'EBGreen', 'author_id': 1358, 'author_profile': 'https://Stackoverflow.com/users/1358', 'pm_score': 2, 'selected': False, 'text': '<p>Or without the year:</p>\n\n<pre><code>DateTime.Now.ToString("M/dd")\n</code></pre>\n'}, {'answer_id': 32760, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 3, 'selected': False, 'text': '<p>If you want it without the year:</p>\n\n<pre><code>DateTime.Now.ToString("MM/DD");\n</code></pre>\n\n<p>DateTime.ToString() has a lot of cool format strings:</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/aa326721.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/aa326721.aspx</a></p>\n'}, {'answer_id': 32764, 'author': 'Billy Jo', 'author_id': 3447, 'author_profile': 'https://Stackoverflow.com/users/3447', 'pm_score': 3, 'selected': False, 'text': '<pre><code>string today = DateTime.Today.ToString("M/d");\n</code></pre>\n'}, {'answer_id': 32819, 'author': 'ljs', 'author_id': 3394, 'author_profile': 'https://Stackoverflow.com/users/3394', 'pm_score': 5, 'selected': False, 'text': '<p>Not to be horribly pedantic, but if you are internationalising the code it might be more useful to have the facility to get the short date for a given culture, e.g.:-</p>\n\n<pre><code>using System.Globalization;\nusing System.Threading;\n\n...\n\nvar currentCulture = Thread.CurrentThread.CurrentCulture;\ntry {\n  Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-us");\n  string shortDateString = DateTime.Now.ToShortDateString();\n  // Do something with shortDateString...\n} finally {\n  Thread.CurrentThread.CurrentCulture = currentCulture;\n}\n</code></pre>\n\n<p>Though clearly the "m/dd/yyyy" approach is considerably neater!!</p>\n'}]
['https://Stackoverflow.com/questions/32747', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/730/']