Date.getTimezoneOffset() (Method)

Returns the time zone offset for the date/time.

Availability:

ECMAScript edition - 2
JavaScript - 1.0
JScript - 1.0
Internet Explorer - 3.02
Netscape - 2.0
Netscape Enterprise Server - 2.0
Opera - 3.0
Property/method value type:Number primitive
JavaScript syntax:-myDate.getTimezoneOffset()

The difference between UTC time and local time measured in minutes.

The result of this method is a zero based integer equal to the time difference between GM reference time and the clock in the client system. The value is measured in minutes and will be in the range 0 to 59 inclusive.

Warnings:

Example code:

   <HTML>

   <HEAD></HEAD>

   <BODY>

   <SCRIPT>

   myDate = new Date();

   myTZO = myDate.getTimezoneOffset();

   if(myTZO == 0)

   {

   document.write("Same time as London, England.");

   }

   else

   {

   document.write(myTZO + " hours relative to London, England time.");

   }

   </SCRIPT>

   </BODY>

   </HTML>

See also:Date.prototype

Cross-references:

ECMA 262 edition 2 - section - 15.9.5.22

ECMA 262 edition 3 - section - 15.9.5.26