Wednesday, March 28, 2012

Javascript Date return NaN in IE 8

Well, UTC suppose to be universal date-time format, but when I do Date.parse() or new Date() with UTC string in IE8, it returns null / NaN  ( while all the browser, including IE9, works ).  Well, it turns out that IE 6 - 8 doesn't understand UTC date-time format :)  Not surprise though, it is IE after-all.

This website has a metrics of javascript Date support for all browsers, pretty handy.
http://dygraphs.com/date-formats.html

One of the solutions is to override Date.parse() when the browser is an IE.

1 comment:

  1. Hi Roy,

    thank you for confirming, I've also wasted a hour of my life for this. One more reason to adore that browser.

    Regards,
    // Rom

    ReplyDelete