[Bug 752007] Re: javascript toLocaleDateString output format YY-MM-YYYY

Vancouverite 752007 at bugs.launchpad.net
Mon Jan 23 20:06:55 UTC 2012


There is more info on this posted in this Zotero Forum:

http://forums.zotero.org/discussion/21431?page=1#Item_18

Basically, if you put in a date as a string like "July, 2 2010" with the
command [code]var d = new Date("July 2, 2010")[/code], the method
[code]d.toLocaleDateString()[/code] gives the output "10-07-2010".

Dan at zotero wrote the code:
""
<pre id="output"></pre>
<script>
var str = "";

var d = new Date("July 2, 2010");

str += "Date is " + d + "\n\n";
str += "toLocaleString: " + d.toLocaleString() + "\n";
str += "toLocaleDateString: " + d.toLocaleDateString() + "\n";

document.getElementById('output').appendChild(document.createTextNode(str));
</script>
""

which produces an output of
""
Date is Fri Jul 02 2010 00:00:00 GMT-0700 (PDT)

toLocaleString: Fri 02 Jul 2010 12:00:00 AM PDT
toLocaleDateString: 10-07-2010
""

-- 
You received this bug notification because you are a member of Mozilla
Bugs, which is subscribed to firefox in Ubuntu.
https://bugs.launchpad.net/bugs/752007

Title:
  javascript toLocaleDateString output format YY-MM-YYYY

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/752007/+subscriptions




More information about the Ubuntu-mozillateam-bugs mailing list