Skip to content

Instantly share code, notes, and snippets.

@tant42
Created March 18, 2013 22:12
Show Gist options
  • Save tant42/5191287 to your computer and use it in GitHub Desktop.
Save tant42/5191287 to your computer and use it in GitHub Desktop.
JS to convert GMT to local time.
// 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