Skip to content

Instantly share code, notes, and snippets.

@yoko
Created January 29, 2009 11:38
Show Gist options
  • Save yoko/54510 to your computer and use it in GitHub Desktop.
Save yoko/54510 to your computer and use it in GitHub Desktop.
Parses date string when format like "2009-01-01T00:00:00Z".
function parseDate(str) {
var d = str.split(/\D/);
--d[1];
var time = Date.UTC.apply(null, d);
return new Date(time);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment