Created
June 7, 2018 06:02
-
-
Save sankarseran/952e7c90f763b5e5446825f9e8daf0cb to your computer and use it in GitHub Desktop.
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
ISODateString(d) { | |
function pad(n) { return n < 10 ? '0' + n : n } | |
return d.getUTCFullYear() + '-' | |
+ pad(d.getUTCMonth() + 1) + '-' | |
+ pad(d.getUTCDate()) + 'T' | |
+ pad(d.getUTCHours()) + ':' | |
+ pad(d.getUTCMinutes()) + ':' | |
+ pad(d.getUTCSeconds()) + 'Z'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment