Skip to content

Instantly share code, notes, and snippets.

@lsmith
Created April 29, 2009 19:34
Show Gist options
  • Save lsmith/104008 to your computer and use it in GitHub Desktop.
Save lsmith/104008 to your computer and use it in GitHub Desktop.
function parseISO8601(str) {
return new Date(str.replace(/-/,"/").
replace(/-/,"/").
replace(/T/," ").
replace(/Z/," UTC").
replace(/([\+-]\d\d)\:?(\d\d)/," $1$2")); // -04:00 -> -0400
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment