Skip to content

Instantly share code, notes, and snippets.

@pritesho
Last active August 29, 2015 14:23
Show Gist options
  • Save pritesho/0368f8e3e24c9d6e81f3 to your computer and use it in GitHub Desktop.
Save pritesho/0368f8e3e24c9d6e81f3 to your computer and use it in GitHub Desktop.
Javascript Timezone Offset Calculation
Javascript Date Magic:
I needed to find whether the current time is EST or EDT. Yes, our server is down locally after 9 PM, but the communication is Async with server and needed to know when the user makes the request is any time zone, is it before end of business day to enable/disabled features.
Moment.js and Moment-timezone.js came out handy and exactly provided the offset.
http://momentjs.com
https://github.com/moment/moment-timezone/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment