Published on
Last updated

Universal JavaScript Date.parse for ISO-8601

Update 2011-06-21: The code formerly hosted here has been upgraded and moved to a GitHub repository.

ECMAScript revision 5 adds native support for ISO-8601 dates in the Date.parse method, but many browsers currently on the market (Safari 4, Chrome 4, IE 6-8) do not support it. Today, I wrote a simple duck punching replacement for Date.parse that will provide support for ISO-8601 strings if the native browser does not.

n.b. yes, I am aware that there are at least two other implementations of this on the Web; they are not nearly as efficient, they do not support all dates that ES5 supports, and they do not provide seamless support via the native Date.parse method.

Get js-iso8601 on GitHub