Last active
September 21, 2019 08:58
-
-
Save zfarbp/e07ee9141f92156cb3a34af58da41362 to your computer and use it in GitHub Desktop.
Javascript: Handling time zone problem
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 now() { | |
const tzoffset = new Date().getTimezoneOffset() * 60; | |
return (new Date(Date.now()/1000 - tzoffset)).getTime(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment