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

Discussion in 'Javascript' started by Rohit, Jul 2, 2008.

  1. Rohit

    Rohit Guest

    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
    Rohit, Jul 2, 2008
    #1
    1. Advertising

  2. Rohit

    Rohit Guest

    Re: How to get when daylight saving starts and ends (date and time)from java script ?

    On Jul 2, 6:36 pm, Rohit <> wrote:
    > 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
    Rohit, Jul 2, 2008
    #2
    1. Advertising

  3. Rohit

    Rohit Guest

    Re: How to get when daylight saving starts and ends (date and time)from java script ?

    On Jul 2, 7:24 pm, Rohit <> wrote:
    > On Jul 2, 6:36 pm, Rohit <> wrote:
    >
    > > 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.lang.javascript/browse_frm/thread...


    second last post from above link
    Rohit, Jul 2, 2008
    #3
  4. Rohit

    RobG Guest

    Re: How to get when daylight saving starts and ends (date and time)from java script ?

    On Jul 3, 12:24 am, Rohit <> wrote:
    > On Jul 2, 6:36 pm, Rohit <> wrote:
    >
    > > 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.lang.javascript/browse_frm/thread...


    You might also try this thread:

    <URL:
    http://groups.google.com.au/group/c...k=gst&q=daylight saving robg#45d24f4dc9f96770
    >



    --
    Rob
    RobG, Jul 3, 2008
    #4
  5. Re: How to get when daylight saving starts and ends (date and time) from java script ?

    In comp.lang.javascript message <fa478142-887b-4b22-ad35-57dc1f35b2db@l2
    8g2000prd.googlegroups.com>, Wed, 2 Jul 2008 16:16:06, RobG
    <> posted:
    >
    >You might also try this thread:
    >
    ><URL:
    >http://groups.google.com.au/group/c...c9f96770?hl=en&lnk=gst&q=daylight saving robg
    >#45d24f4dc9f96770



    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

    --
    (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05.
    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.
    Dr J R Stockton, Jul 3, 2008
    #5
  6. Rohit

    RobG Guest

    Re: How to get when daylight saving starts and ends (date and time)from java script ?

    On Jul 4, 3:56 am, Dr J R Stockton <> wrote:
    > In comp.lang.javascript message <fa478142-887b-4b22-ad35-57dc1f35b2db@l2
    > 8g2000prd.googlegroups.com>, Wed, 2 Jul 2008 16:16:06, RobG
    > <> posted:
    >
    > >You might also try this thread:

    >
    > ><URL:
    > >http://groups.google.com.au/group/comp.lang.javascript/browse_frm/thr...
    > >#45d24f4dc9f96770

    >
    > 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 >


    --
    Rob
    RobG, Jul 7, 2008
    #6
  7. Re: How to get when daylight saving starts and ends (date and time) from java script ?

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


    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.

    --
    (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05.
    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.
    Dr J R Stockton, Jul 7, 2008
    #7
  8. Re: How to get when daylight saving starts and ends (date and time) from java script ?

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

    > <URL:http://www.merlyn.demon.co.uk/js-datec.htm#GUTZ>


    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.

    --
    (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05.
    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.
    Dr J R Stockton, Jul 7, 2008
    #8
  9. Rohit

    RobG Guest

    Re: How to get when daylight saving starts and ends (date and time)from java script ?

    Dr J R Stockton wrote:
    > In comp.lang.javascript message <84d4c506-0b62-49fd-b721-f0847716d990@y2
    > 1g2000hsf.googlegroups.com>, Sun, 6 Jul 2008 18:08:33, RobG
    > <> posted:
    >>> 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.


    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


    --
    Rob
    RobG, Jul 9, 2008
    #9
  10. Re: How to get when daylight saving starts and ends (date and time) from java script ?

    In comp.lang.javascript message <48740fd3$0$7209$5a62ac22@per-
    qv1-newsreader-01.iinet.net.au>, Wed, 9 Jul 2008 11:39:43, RobG
    <> posted:
    >Dr J R Stockton wrote:
    >> In comp.lang.javascript message <84d4c506-0b62-49fd-b721-f0847716d990@y2
    >> 1g2000hsf.googlegroups.com>, Sun, 6 Jul 2008 18:08:33, RobG
    >> <> posted:
    >>>> 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.

    >
    >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.

    --
    (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05.
    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.
    Dr J R Stockton, Jul 9, 2008
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pranav Kantawala
    Replies:
    5
    Views:
    738
    P.Hill
    Feb 25, 2004
  2. Replies:
    1
    Views:
    347
    Irrwahn Grausewitz
    Sep 9, 2005
  3. Etantonio
    Replies:
    3
    Views:
    555
    timjowers
    Apr 10, 2008
  4. Harlan Messinger

    Dates, time zones,daylight saving time

    Harlan Messinger, Apr 15, 2010, in forum: ASP .Net
    Replies:
    1
    Views:
    1,005
    Eric Isaacs
    Apr 16, 2010
  5. George
    Replies:
    47
    Views:
    499
    George
    Sep 29, 2006
Loading...

Share This Page