Created
May 28, 2014 19:29
-
-
Save HasStacey/397cd2ebca1c3aa93346 to your computer and use it in GitHub Desktop.
Get the current timezone
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
$(document).ready(function(){ | |
function get_time_zone_offset() { | |
var current_date = new Date(); | |
return -current_date.getTimezoneOffset() / 60; | |
} | |
$('body').append('The local time zone is: GMT ' + get_time_zone_offset()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment