Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

Feedback: The 24 Hour World

Feedback on: The 24 Hour World

Sent by Morten Wang on March 09, 2000 at 04:48:23: - feedback #908

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



Sent by Mark Patterson on April 26, 2000 at 18:19:52: - feedback #1147

Worth:
Very worth reading

Comments:
Hi Martin,

And thanks for posting your article.

I really hope to be able to use your "local times in selectable cities" java script on our little support department intranet. It seems our support staff have a hard time remembering that they can't phone our customers in Australia at 10am Pacific time. Well, not without waking someone up!

So I've cut and pasted your script into an HTML editor (FrontPage Editor -- I know that's not great, but it's all I have handy).

Anyway, I'm getting an error message that I can't seem to correct. When I view the script my browser (IE 5.0) says:

An error has occured in the script on this page

Line: 20
Char: 5
Error: 'document.formname.theirzone' is not an object
Code: 0
URL: file://C:\ProgramFiles\MicrosoftFrontPage\temp\pvw32.htm

Do you want to continue running scripts on this page? Y/N"

If I select "Yes" it shows the drop-down window just fine but the window where the time should display is blank.

Can you give me any pointers about why the object is not being recognized? I've combed over the script in my little page as compared to yours (at: http://www.irt.org/articles/js076/) and they match exactly.

Any help would be very much appreciated.

Thanks,

- Mark

mpatterson@eosintl.com


Sent by Richard Chevalier on September 08, 2000 at 14:37:42: - feedback #1732

Worth:
Worth reading

Length:
Just right

Technical:
Just right

Comments:
It's very interesting to have The 24 Hour World in my computer with AM/PM and I don't have those AM/PM to set up. Where can i get those to works?

Thanks,
Richard C.


Sent by Darren Neimke on March 10, 2002 at 05:42:40: - feedback #3672

Worth:
Worth reading

Comments:
You can find a useful js class for working with TimeZones here:

http://www.flws.com.au/showusyourcode/codeLib/code/TimeMachine1.asp?CatID=2


Sent by Mark Read on January 29, 2003 at 17:45:59: - feedback #4391

Worth:
Very worth reading

Length:
Just right

Technical:
Just right

Comments:
An excellent article that claely walks you step by step through the various Javascript date() methods in the context of timezone offset calculations. Well done Martin!


©2018 Martin Webb