How to get when daylight saving starts and ends (date and time) fromjava script ?

R

Rohit

I am trying to construct uclibc style timezone string(e.g. GMT
+0IST-1,M3.5.0/01:00:00,M10.5.0/02:00:00) from javascript but do not
know how can i get when DST starts and ends from my script.I need to
know which day/week/month and time if not 2 a.m when DST setting start
taking effect and also stop taking effect.

Any suggestions ?

-- Rohit
 
R

Rohit

I am trying to construct uclibc style timezone string(e.g. GMT
+0IST-1,M3.5.0/01:00:00,M10.5.0/02:00:00) from javascript but do not
know how can i get when DST starts and ends from my script.I need to
know which day/week/month and time if not 2 a.m when DST setting start
taking effect and also stop taking effect.

Any suggestions ?

-- Rohit

I found this. Seems to be what i need but not sure about its
correctness. Will anybody confirm ??

http://groups.google.com/group/comp...start+of+dst+from+javascript#e77182e0187b0338
 
D

Dr J R Stockton

In comp.lang.javascript message <fa478142-887b-4b22-ad35-57dc1f35b2db@l2
8g2000prd.googlegroups.com>, Wed, 2 Jul 2008 16:16:06, RobG


I never saw why you thought that it might be necessary to check at
three-monthly intervals in order to detect Summer Time. To be logical,
Summer and Winter Time should be centred on the solstices; but the
actual dates seem generally to be somewhat later. So checking January
1st and July 1st will find Summer and Winter, not necessarily in that
order.

Do you know anyone with a machine correctly set for Lord Howe Island?
Without that, <URL:http://www.merlyn.demon.co.uk/js-datec.htm#GUTZ>
cannot be completely tested.

For Amsterdam, it gives std-1smr,M3.5.0/02:00:00,M10.5.0/03:00:00
For Hobart, it gives std-10smr,M10.1.0/02:00:00,M4.1.0/03:00:00
For Kathmandu, it gives std-5:45
 
R

RobG

In comp.lang.javascript message <fa478142-887b-4b22-ad35-57dc1f35b2db@l2
8g2000prd.googlegroups.com>, Wed, 2 Jul 2008 16:16:06, RobG



I never saw why you thought that it might be necessary to check at
three-monthly intervals in order to detect Summer Time.  To be logical,
Summer and Winter Time should be centred on the solstices; but the
actual dates seem generally to be somewhat later.  So checking January
1st and July 1st will find Summer and Winter, not necessarily in that
order.

As far as I know, the start and end of daylight saving is a
bureaucratic decision, logical may not enter into it. If logic
prevailed we'd probably get rid of daylight saving altogether as it
serves no useful purpose other than increase retail sales. :)

So as a compromise between checking too often (every day or month) and
checking the minimum reasonable (say June and December 21 or 22), I
went for 4 times at 3 month intervals. I think your logic of the
solstices is reasonable.

Do you know anyone with a machine correctly set for Lord Howe Island?

No, but I can probably arrange it.

Without that, <URL:http://www.merlyn.demon.co.uk/js-datec.htm#GUTZ>
cannot be completely tested.

Lord Howe Is is under the jurisdiction of New South Wales and seems to
follow the same dates for start and end - first Sunday in October and
April respectively. The Standard Time Act 1987 allows the NSW Govenor
to set the dates to whatever she wishes.

<URL: http://www.legislation.nsw.gov.au/fragview/inforce/act+149+1987+pt.3-TOP+0+N

There are dates at the link below that you likely already know about.

<URL: http://www.timeanddate.com/worldclock/timezone.html?n=750 >
 
D

Dr J R Stockton

In comp.lang.javascript message <84d4c506-0b62-49fd-b721-f0847716d990@y2
1g2000hsf.googlegroups.com>, Sun, 6 Jul 2008 18:08:33, RobG
No, but I can probably arrange it.



Lord Howe Is is under the jurisdiction of New South Wales and seems to
follow the same dates for start and end - first Sunday in October and
April respectively. The Standard Time Act 1987 allows the NSW Govenor
to set the dates to whatever she wishes.

The Lord Howe Island change dates are typical. The special interest
lies in the amount of the clock change, 30 minutes, which means that the
second offset field cannot be blank (which means a change of one hour),
but must give the Summer offset as HH:MM.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
rlyn.invalid>, Thu, 3 Jul 2008 18:56:24, Dr J R Stockton

should now be correct for Morocco and Mauritius, where they apparently
need J-type Summer Time rules rather than M-type. I don't think a TZ
string can accommodate the rules which seem to apply in Israel and in
Iran. Of course, OS support is needed for the proper Rules, and may be
lacking.
 
R

RobG

Dr said:
In comp.lang.javascript message <84d4c506-0b62-49fd-b721-f0847716d990@y2
1g2000hsf.googlegroups.com>, Sun, 6 Jul 2008 18:08:33, RobG

I set my local machine to Lord Howe time, your page shows:

Your TZ is : std-10:30smr-11,M10.1.0/02:00,M4.1.0/02:00
 
D

Dr J R Stockton

In comp.lang.javascript message <48740fd3$0$7209$5a62ac22@per-
qv1-newsreader-01.iinet.net.au>, Wed, 9 Jul 2008 11:39:43, RobG
I set my local machine to Lord Howe time, your page shows:

Your TZ is : std-10:30smr-11,M10.1.0/02:00,M4.1.0/02:00

Winter time, 10:30 ahead of GMT; Summer, 11:00 ahead.
Start at 1st Sun of Oct at 02:00 clock, go ahead to 02:30.
Stop at 1st Sun of Apr at 02:00 clock, go back to 01:30.

All seems to be well. It agrees with all available information. That
section of js-datec.htm has now been put in js-date2.htm. All we need
now are tests in Morocco, Mauritius, Iran, Israel. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top