Description
The getTimezoneOffset() method returns the time difference between Greenwich Mean Time (GMT) and local time, in minutes.
This method has the form:
Date.getTimezoneOffset()
Examples
The following example shows the basic use of this method.
<script>
var d = new Date();
var gmtHours = -d.getTimezoneOffset()/60;
document.write("GMT "+gmtHours);
</script>
This produces the following result:
Browser Support
Firefox | IE | Chrome | Opera | Safari |
---|---|---|---|---|