The getTimezoneOffset method returns the difference in minutes between the universal time and the time in the host computer. The value returned by this method is an integer number.
Syntax
myDate.getTimezoneOffset()
With myDate being an object based on the Date object.
Instead of being instantiated from a class, in JavaScript objects are created by replicating other objects. This paradigm is called Prototype-based programming.
Example
The following code uses the getTimezoneOffset method to return the difference in minutes between he universal time and the time in the host computer:
<script type="text/javascript">
var currentTime = new Date();
var differenceToUniversalTime = currentTime.getTimezoneOffset();
document.write("The temporal difference between the universal time and the time in the host computer is " + differenceToUniversalTime + " minutes.");
</script>
var currentTime = new Date();
var differenceToUniversalTime = currentTime.getTimezoneOffset();
document.write("The temporal difference between the universal time and the time in the host computer is " + differenceToUniversalTime + " minutes.");
</script>
Technical Details
The getTimezoneOffset method belongs to the Date object, it is available since the version 1.0 of JavaScript, and it is supported in all major browsers.
JavaScript Manual >> Date Object >> getTimezoneOffset Method