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.
Note that international time zones are generally in 60-minute intervals. However, a very few are less than 60 minutes.
There are deficiencies in the accuracy of this method in Netscape 2 and 3. You should test whether your scripts work properly on those browsers if backwards compatibility is important to your project.
<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 |
Prev | Home | Next |
Date.getTime() | Up | Date.getUTCDate() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |