Created
April 5, 2012 11:23
-
-
Save amitpatelx/2310060 to your computer and use it in GitHub Desktop.
Get timezone offset in browser using javascript
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
function getTimezone(){ | |
var current_date_time = new Date(); | |
currentTimeZoneOffsetInHours = (-1) * current_date_time.getTimezoneOffset()/60; | |
return currentTimeZoneOffsetInHours; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment