Created
January 12, 2017 08:48
-
-
Save motss/71ef2c4844e172799fadb3ab670f9133 to your computer and use it in GitHub Desktop.
Convert native Date object with timezone offset
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
d = new Date(); | |
dl = new Date(d.getTime() - d.getTimezoneOffset() * 60 * 1E3); | |
console.log(d); | |
console.log(dl.toISOString()); | |
console.log(d.getTimezoneOffset / -60); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment