Created
March 18, 2013 22:12
-
-
Save tant42/5191287 to your computer and use it in GitHub Desktop.
JS to convert GMT to local time.
This file contains hidden or 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
// Server sends GMT, adjust to local time. | |
var localDate = new Date(data.date) | |
localDate = new Date(localDate.getTime() - (localDate.getTimezoneOffset() * 60 * 1000)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment