Skip to content

Instantly share code, notes, and snippets.

@alexdiliberto
Created June 7, 2014 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexdiliberto/dca011ce6acc634ba6f2 to your computer and use it in GitHub Desktop.
Save alexdiliberto/dca011ce6acc634ba6f2 to your computer and use it in GitHub Desktop.
Get the user's timezone (client-side)
/**
Intl.DateTimeFormat().resolvedOptions()
Object {locale: "en-US", numberingSystem: "latn", calendar: "gregory", timeZone: "America/New_York", year: "numeric"…}
calendar: "gregory"
day: "numeric"
locale: "en-US"
month: "numeric"
numberingSystem: "latn"
timeZone: "America/New_York"
year: "numeric"
__proto__: Object
*/
Intl.DateTimeFormat().resolvedOptions().timeZone;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment