Created
January 29, 2009 11:38
-
-
Save yoko/54510 to your computer and use it in GitHub Desktop.
Parses date string when format like "2009-01-01T00:00:00Z".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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