473,507 Members | 8,022 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subtle Date Problems

(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
4 1573
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2014
by: bonono | last post by:
Hi, I initially thought that generator/generator expression is cool(sort of like the lazy evaluation in Haskell) until I notice this side effect. >>>a=(x for x in range(2)) >>>list(a) ...
5
8780
by: Corky | last post by:
This works: db2 SELECT DISTINCT PROBLEM_OBJECTS.PROBLEM_ID FROM PROBLEM_OBJECTS INNER JOIN PROBLEMS ON PROBLEM_OBJECTS.PROBLEM_ID = PROBLEMS.PROBLEM_ID WHERE INTEGER(DAYS(CURRENT DATE) -...
13
3067
by: Deano | last post by:
Hi, I generate a report using two dates (From and To). I notice if I enter 01/10/2003 that it is interpreted by Access as 10/01/2003 i.e 10th January rather than 1st October as I intended. ...
3
2340
by: JJ | last post by:
Here's the code. $link="http://xbox360cheat.org"; $close_date=$_POST; #last content change check if ($close_date == 0) $close_date = date("Y-m-d H:m:s", mktime(12, 0, 0, date("m"), date...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7105
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
410
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.