Does Javascript/EcmaScript3 support ISO8601 date parsing?

Posted by AlexanderN on Stack Overflow See other posts from Stack Overflow or by AlexanderN
Published on 2010-03-19T18:32:45Z Indexed on 2010/03/19 18:51 UTC
Read the original article Hit count: 514

Filed under:
|
|

How are you currently parsing ISO8601 dates e.g. 2010-02-23T23:04:48Z in JavaScript?

Some browsers return NaN (including Chrome) when using the code below, FF3.6+ works though.

<html>
<body>
  <script type="text/javascript">
  var d = Date.parse("2010-02-23T23:04:48Z");
  document.write(d);
</script>
</body>
</html>

You can try this here http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_parse

ps: DateJs doesn't seem to support ISO8601 parsing.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about datetime