<p>What is the best way to localise a date format descriptor?</p>

<p>As anyone from a culture which does not use the mm/dd/yyyy format knows, it is annoying to have to enter dates in this format. The .NET framework provides some very good localisation support, so it's trivial to parse dates according to the users culture, but you often want to also display a helpful hint as to the format required (especially to distinguish between yy and yyyy which is interchangeable in most cultures).</p>

<p>What is the best way to do this in a way that make sense to most users (e.g. dd/M/yyy is confusing because of the change in case and the switching between one and two letters).</p>

[{'answer_id': 762, 'author': 'ICR', 'author_id': 214, 'author_profile': 'https://Stackoverflow.com/users/214', 'pm_score': 3, 'selected': True, 'text': '<p>Here is my current method. Any suggestions?</p>\n\n<pre><code>Regex singleMToDoubleRegex = new Regex("(?&lt;!m)m(?!m)");\nRegex singleDToDoubleRegex = new Regex("(?&lt;!d)d(?!d)");\nCultureInfo currentCulture = CultureInfo.CurrentUICulture;\n\n// If the culture is netural there is no date pattern to use, so use the default.\nif (currentCulture.IsNeutralCulture)\n{\n    currentCulture = CultureInfo.InvariantCulture;\n}\n\n// Massage the format into a more general user friendly form.\nstring shortDatePattern = CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern.ToLower();\nshortDatePattern = singleMToDoubleRegex.Replace(shortDatePattern, "mm");\nshortDatePattern = singleDToDoubleRegex.Replace(shortDatePattern, "dd");\n</code></pre>\n'}, {'answer_id': 763, 'author': 'Yaakov Ellis', 'author_id': 51, 'author_profile': 'https://Stackoverflow.com/users/51', 'pm_score': 1, 'selected': False, 'text': '<p>How about giving the format (mm/dd/yyyy or dd/mm/yyyy) followed by a printout of today\'s date in the user\'s culture. MSDN has an article on <a href="http://msdn.microsoft.com/en-us/library/5hh873ya(VS.71).aspx" rel="nofollow noreferrer">formatting a DateTime for the person\'s culture</a>, using the CultureInfo object that might be helpful in doing this. A combination of the format (which most people are familiar with) combined with the current date represented in that format should be enough of a clue to the person on how they should enter the date. (Also include a calendar control for those who still cant figure it out).</p>\n'}, {'answer_id': 770, 'author': 'engtech', 'author_id': 175, 'author_profile': 'https://Stackoverflow.com/users/175', 'pm_score': 3, 'selected': False, 'text': '<p><a href="http://en.wikipedia.org/wiki/ISO_8601" rel="nofollow noreferrer">Just use ISO-8601</a>. It\'s an international standard.</p>\n\n<pre><code>Date and time (current at page generation) expressed according to ISO 8601:\nDate:                           2014-07-05\nCombined date and time in UTC:  2014-07-05T04:00:25+00:00\n                                2014-07-05T04:00:25Z\nWeek:                           2014-W27\nDate with week number:          2014-W27-6\nOrdinal date:                   2014-186\n</code></pre>\n'}, {'answer_id': 1077, 'author': 'ICR', 'author_id': 214, 'author_profile': 'https://Stackoverflow.com/users/214', 'pm_score': 2, 'selected': False, 'text': "<p>The trouble with international standards is that pretty much noone uses them. I try where I can, but I am forced to use dd/mm/yyyy almost everywhere in real life, which means I am so used to it it's always a conscious process to use ISO-8601. For the majority of people who don't even try to use ISO-8601 it's even worse. If you can internationalize where you can, I think it's a great advantage.</p>\n"}, {'answer_id': 1495, 'author': 'sparkes', 'author_id': 269, 'author_profile': 'https://Stackoverflow.com/users/269', 'pm_score': 2, 'selected': False, 'text': '<p>I have to agree with the OP \'wrong\' dates really jar with my DD/MM/YYYY upbringing and I find ISO 8601 dates and times extremely easy to work with.  For once the standard got it right and <a href="https://stackoverflow.com/questions/761/#770">engtech</a> has the obvious answer that doesn\'t require localisation.</p>\n\n<p>I was going to report the birthday input form on stack overflow as a bug because of how much of a sore thumb it is to the majority of the world.</p>\n'}, {'answer_id': 1524, 'author': 'McDowell', 'author_id': 304, 'author_profile': 'https://Stackoverflow.com/users/304', 'pm_score': 1, 'selected': False, 'text': '<p>A short form is convenient and helps avoid spelling mistakes. Localize as applicable, but be sure to display the expected format (do not leave the user blind). Provide a date-picker control as an <em>optional</em> aide to filling in the field.</p>\n\n<p>As an extra, on-the-fly parsing and display of the date in long form might help too.</p>\n'}, {'answer_id': 103717, 'author': 'user19050', 'author_id': 19050, 'author_profile': 'https://Stackoverflow.com/users/19050', 'pm_score': 0, 'selected': False, 'text': '<p><strong>Best option</strong>: I would instead recommend to use a standard date picker.</p>\n\n<p><strong>Alternative</strong>: every time the content of the edit control changes, parse it and display (in a separate control?) the long format of the date (ie: input "03/04/09" display "Your input: March 4, 2009")</p>\n'}]
['https://Stackoverflow.com/questions/761', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/214/']