By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,142 Members | 1,839 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,142 IT Pros & Developers. It's quick & easy.

Subtle Date Problems

P: n/a
(A) Some of us in the UK will have been watching with amusement what
seems to be happening in the USA and its Northern Sidekick with regard
to the change in DST rules.

I've discovered that the change will also be happening in the Bahamas
(Commonwealth), Bermuda and Turks & Caicos (British Overseas
Territories) - I wonder whether anyone told Her Majesty?
(B) Date Validation - ISTM that using D = new Date(y, m', d) then
checking getMonth and getDate may well fail on one or two days of the
year for users in the Azores and in South-East Greenland.

Time validation by similar means could occasionally fail likewise
anywhere that has Summer Time - but probably not, depending on code.
(C) US+ DST changes can be important for anything hard-coded for the
afflicted areas, and for machines there with non-updated OS data.

It's a good idea to read the newsgroup and its FAQ. See below.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Mar 3 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Fri, 2 Mar 2007 at 20:42:57, in comp.lang.javascript, Dr J R Stockton
wrote:

<snip>
>(B) Date Validation - ISTM that using D = new Date(y, m', d) then
checking getMonth and getDate may well fail on one or two days of the
year for users in the Azores and in South-East Greenland.
<snip>

Why not test at noon instead of midnight ?

John
--
John Harris
Mar 3 '07 #2

P: n/a
In comp.lang.javascript message <vz**************@J.A830F0FF37FB96852AD0
8924D9443D28E23ED5CD>, Sat, 3 Mar 2007 19:59:31, John G Harris
<jo**@nospam.demon.co.ukposted:
>On Fri, 2 Mar 2007 at 20:42:57, in comp.lang.javascript, Dr J R Stockton
wrote:

<snip>
>>(B) Date Validation - ISTM that using D = new Date(y, m', d) then
checking getMonth and getDate may well fail on one or two days of the
year for users in the Azores and in South-East Greenland.
<snip>

Why not test at noon instead of midnight ?
One would not then be using D = new Date(y, m', d) and it is that
which has commonly been suggested. One fix would be to use D = new
Date(y, m', d, 12) but unless it is necessary to minimise code size it
would seem better to do the work in UTC. To minimise code size, use say
.... d, 9) <g>.
--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6.
Web <URL:http://www.merlyn.demon.co.uk/- w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/- see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
Mar 4 '07 #3

P: n/a
VK
On Mar 2, 11:42 pm, Dr J R Stockton <reply0...@merlyn.demon.co.uk>
wrote:
(A) Some of us in the UK will have been watching with amusement what
seems to be happening in the USA and its Northern Sidekick with regard
to the change inDSTrules.
It is nice of you to observe the metropolitan events :-) but what
exact impact do you envisage for javascript programming out of it?

JavaScript/JScript engine obtains Date data over request to the
hosting OS, the engine doesn't have own clock and transformation
tables. So it's up to end user to get ready for March 11 deadline.

Windows Vista series is ready for the DST changes by default.

Windows XP SP2 users should check if they have KB931836 update
installed. If not then go get it at:
http://www.microsoft.com/downloads/d...9-EF9061A9A3CA

Windows 2000 users will have to use Windows Time Zone Editor. Free
download and step-by-step instructions are here:
http://support.microsoft.com/gp/dst_hu2?systemlist=w32

The users of discontinued series (Windows 98, ME etc) are on their
own.
Presumably other OS (MacOS etc) took care of the problem as well.

If one uses Microsoft Outlook, she should take care of the existing
appointments and events:
http://www.download.com/Time-Zone-Da...ml?tag=lst-0-1

There is no way to check OS state from within javascript with default
security settings, so nothing one can do helpful from the script side.

Mar 7 '07 #4

P: n/a
In comp.lang.javascript message <11**********************@64g2000cwx.goo
glegroups.com>, Wed, 7 Mar 2007 10:01:58, VK <sc**********@yahoo.com>
posted:
>On Mar 2, 11:42 pm, Dr J R Stockton <reply0...@merlyn.demon.co.uk>
wrote:
>(A) Some of us in the UK will have been watching with amusement what
seems to be happening in the USA and its Northern Sidekick with regard
to the change inDSTrules.

It is nice of you to observe the metropolitan events :-) but what
exact impact do you envisage for javascript programming out of it?
You would know more about that if you were to read through the FAQ and
its appropriate linked sites. I see no need to repeat the whole
material here. You should also read Risks Digest.

>JavaScript/JScript engine obtains Date data over request to the
hosting OS, the engine doesn't have own clock and transformation
tables. So it's up to end user to get ready for March 11 deadline.
Inadequate. It only obtains data for the current locality. That's no
help to a Tasmanian who wants the time in Saskatchewan. A Nigerian
writing a page to provide that will need to know about Canadian DST.
Businesses often need to know the time - and date - elsewhere.

>Windows Vista series is ready for the DST changes by default.
And it will provide 2007 rules from 2007 March 11th and 2006 rules up to
2006 November 7th. I don't know what it does in between. US Federal
legislation makes the change of rule effective on March 1st (local time?
Capitol time?) but few Americans know that.

Javascript, by the ISO/IEC standard, is required to use only current
rules for all dates. Results for dates late in March 2006 should have
changed at 00:00:00 March 1st 2006, exactly.

>Windows XP SP2 users should check if they have KB931836 update
installed. If not then go get it at:
http://www.microsoft.com/downloads/d...66F1420C-DF2D-
400B-A8A9-EF9061A9A3CA
If they did not install it at midnight F28/M01, they will have been open
to non-compliance with the standard.

>There is no way to check OS state from within javascript with default
security settings, so nothing one can do helpful from the script side.
Round Objects. Standard Javascript can determine the exact date and
time of the changes, by the rules current at the time of determining, at
the current locality for any year within about +-275000 from Epoch. For
those locations that currently have Summer Time, it can also determine
the sign of the latitude[*] and the approximate longitude. I'm willing
to believe, of course, that you do not know how to do so.
[*] I imagine that the Irish[+] Navy, which rarely goes far, may keep
Dublin Time. But how about the RN & USN? Do they use the home change
rules even when on the other side of the Equator?

[+] The Republic of Ireland had, from 1968, Standard Time one hour ahead
of GMT. Instead of putting clocks ahead for Summer, they put them back
for Winter. That seems likely to be against present EU law.

It's a good idea to read the newsgroup and its FAQ. See below.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Mar 8 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.