Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GMT Zone signe

Status
Not open for further replies.

JCV

Programmer
Mar 14, 2002
33
AR
Hi,
I´m need obtain the GMT zone of the visitor at my site for contact then by telephone.
I´m using the date.getTimezoneOffset() function, but then allways return a positive number, (I live in Buenos Aires, Argentina GMT -3 , an this function return 3).
I need know if the visitor live in New York or in Rome, at left or right of Greenwich.
I ´m using MSIE 6.

Thanks.

 
Positive time zone, negative bias; negative, postiive.
[tt]
var bias_hour=((new Date()).getTimezoneOffset()/60).toFixed();
[/tt]
 
Thanks tsuji, but this give me a POSITIVE number... (3), instead of -3 (a NEGATIVE number for Buenos Aires).

The funcion is losing the signe ?



 
But that depends on how to see the thing. Lagging behind GMT time (negative time zone) means GMT time is biased positively with respect to local time and vice versa. If you want to reverse the sign, just multiply -1 on the right-hand-side and interprete the variable accordingly...
 
Thanks tsuji, i´m reversed the sign and this work fine at East and West of GMT 0.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top