Skip to content

Instantly share code, notes, and snippets.

@pritesho
pritesho / gist:0368f8e3e24c9d6e81f3
Last active August 29, 2015 14:23
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/