0

In my browser

new Date("05/06/2013")  

is treated as M/D/YY. So above date will 5th of June.

I am using the US date format. I believe JavaScript lets the browser decide the locale. But how do I check what locale the browser users at runtime?

Thanks.

More Than Five
  • 9,959
  • 21
  • 77
  • 127
  • see http://stackoverflow.com/q/2587345/2170192 – Alex Shesterov Jun 24 '13 at 09:48
  • Date parsing is almost entirely implementation dependent. For formats like the OP, most (all?) browsers will default to US format (m/d/y) for historical (not practical) reasons. The locale is used for output (e.g. [Date.prototype.toLocaleDateString](http://ecma-international.org/ecma-262/5.1/#sec-15.9.5.6)), not input. If you need to parse a string, do it yourself. – RobG Jun 24 '13 at 09:57

0 Answers0