Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Feedback on: The 24 Hour World

irt.org | About | Feedback | 908 [ previous next ]

Feedback on:
The 24 Hour World

Sent by
Morten Wang on March 09, 2000 at 04:48:23:

Worth:
Worth reading

Length:
Too long

Technical:
Just right

Comments:
A few quotes that are worth commenting on:
"The one we are interested in for this article is getTimezoneOffset, which as mentioned above returns the timezone offset in minutes of the current locale from GMT0."

"JScript 1.0, Microsofts implementation of JavaScript in Microsoft Internet Explorer 3.x, returns the timezone offset in the wrong sign. All other browsers, including Microsoft Internet Explorer 4.x, return the timezone offset as the differnce, in minutes between GMT0 and the current locale, i.e. if the current locale is New York, then the timezone offset is -5 * 60 or -300."

This is not exactly correct. getTimezoneOffset() returns a _negative_ value if the current timezone is _ahead_ of GMT, and a _positive_ value if the current timezone is _behind_ GMT. therefore, the New York example will return +300, and not -300. The advantage of this is that it's easy to get GMT from the current time, simply add 'offset*60*1000' to getTime().

IE5, Opera 3.62b2 and Netscape 4.72 & 3.04 all return -60 for CET (GMT+0100).

The behaviour of getTimezoneOffset() is not explained in Netscape's reference (http://developer.netscape.com/docs/manuals/js/client/jsref/date.htm#1193844), but it is in Microsoft's reference: http://msdn.microsoft.com/scripting/jscript/doc/jsDategetTimeZone.htm



Other feedback on 'The 24 Hour World' - show all


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 21st December 2007. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.