Daylight savings time in US

Discussion in 'Ruby' started by Ernest Ellingson, Feb 15, 2007.

  1. As most of you know the dates when DST begins and ends in the US have
    changed.
    On Sun. Mar, 11 at 2:00 AM Std time the clocks should move forward 1 hour.

    On Sun. Nov, 4, at 2:00 AM DST the clocks should move back 1 hour.

    I have updated my linux boxes for the new times.

    I get correct answers for
    t=Time.mktime(2007,3,12)
    t.isdst => true
    t=Time.mktime(2007,11,3)
    t.isdst => true
    t=Time.mktime(2007,11,5)
    t.isdst => false

    However, On Windows XP, even though I have updated the settings
    for DST, Ruby 1.85 (one click installer) reports incorrectly

    t=Time.mktime(2007,3,12)
    t.isdst => false
    t=Time.mktime(2007,11,3)
    t.isdst => false

    Does this have something to do the machine on which ruby was compiled?
    Or does it have some other cause?

    Ernie
    Ernest Ellingson, Feb 15, 2007
    #1
    1. Advertising

  2. Ernest Ellingson

    Eric I. Guest

    I'm sure the Time class' isdst method is making a call into the
    standard C library, first by calling the localtime function and then
    looking at the tm_isdst field of the returned structure. Therefore it
    depends on which version of the standard C library is being called,
    i.e., what's installed on the machine you compiled on.

    Eric

    Interested in hands-on, on-site Ruby training? See http://
    LearnRuby.com
    for information about a well-reviewed class.
    Eric I., Feb 15, 2007
    #2
    1. Advertising

  3. Eric I. wrote:
    > I'm sure the Time class' isdst method is making a call into the
    > standard C library, first by calling the localtime function and then
    > looking at the tm_isdst field of the returned structure. Therefore it
    > depends on which version of the standard C library is being called,
    > i.e., what's installed on the machine you compiled on.
    >
    > Eric
    >
    > Interested in hands-on, on-site Ruby training? See http://
    > LearnRuby.com
    > for information about a well-reviewed class.
    >

    The Ruby version I'm using on windows (1.85) I installed using the
    pre-compiled installation. I don't know what it used to compile it
    although I'm pretty certain its some version of Microsoft's compiler.

    Ernie
    Ernest Ellingson, Feb 15, 2007
    #3
  4. Ernest Ellingson wrote:
    > Eric I. wrote:
    >> I'm sure the Time class' isdst method is making a call into the
    >> standard C library, first by calling the localtime function and then
    >> looking at the tm_isdst field of the returned structure. Therefore it
    >> depends on which version of the standard C library is being called,
    >> i.e., what's installed on the machine you compiled on.
    >>
    >> Eric
    >>
    >> Interested in hands-on, on-site Ruby training? See http://
    >> LearnRuby.com
    >> for information about a well-reviewed class.
    >>

    > The Ruby version I'm using on windows (1.85) I installed using the
    > pre-compiled installation. I don't know what it used to compile it
    > although I'm pretty certain its some version of Microsoft's compiler.
    >
    > Ernie

    Here's some more information. I actually have Ruby working correctly in
    Windows now. I left out an important step in updating a windows
    machine. First use TZedit.exe (
    http://www.softshape.com/download/tzedit.zip )
    to set the correct dates for DST to begin and end. Then (here's what I
    didn't do) in Control panel choose Date and Time, choose the Time zone
    tab. Select another time zone other than the one you are in. Click OK
    Select Date and Time again, choose the Time zone tab. Choose your
    actual time zone from the drop down list. Click ok. Ruby now works
    fine.

    Ernie
    Ernest Ellingson, Feb 15, 2007
    #4
  5. Ernest Ellingson

    Ken Bloom Guest

    On Wed, 14 Feb 2007 22:28:58 -0500, Ernest Ellingson wrote:

    > As most of you know the dates when DST begins and ends in the US have
    > changed.
    > On Sun. Mar, 11 at 2:00 AM Std time the clocks should move forward 1 hour.
    >
    > On Sun. Nov, 4, at 2:00 AM DST the clocks should move back 1 hour.
    >
    > I have updated my linux boxes for the new times.
    >
    > I get correct answers for
    > t=Time.mktime(2007,3,12)
    > t.isdst => true
    > t=Time.mktime(2007,11,3)
    > t.isdst => true
    > t=Time.mktime(2007,11,5)
    > t.isdst => false
    >
    > However, On Windows XP, even though I have updated the settings
    > for DST, Ruby 1.85 (one click installer) reports incorrectly
    >
    > t=Time.mktime(2007,3,12)
    > t.isdst => false
    > t=Time.mktime(2007,11,3)
    > t.isdst => false
    >
    > Does this have something to do the machine on which ruby was compiled?
    > Or does it have some other cause?


    This has to do with the systemwide timezone database on the system where
    ruby is running. It appears that Linux has been updated for this for a
    good long time (i.e. since the bill was signed into law), but Windows
    they're only just starting to patch. See http://tinyurl.com/2nqdpf for the
    fix. I'm not sure whether they're going to push this out by Windows Update
    to you, but it's only been available for about a week now.

    Long live Linux, whose developers care about the future.

    --Ken

    --
    Ken Bloom. PhD candidate. Linguistic Cognition Laboratory.
    Department of Computer Science. Illinois Institute of Technology.
    http://www.iit.edu/~kbloom1/
    Ken Bloom, Feb 15, 2007
    #5
  6. Ken Bloom wrote:
    > On Wed, 14 Feb 2007 22:28:58 -0500, Ernest Ellingson wrote:
    >
    >> As most of you know the dates when DST begins and ends in the US have
    >> changed.
    >> On Sun. Mar, 11 at 2:00 AM Std time the clocks should move forward 1 hour.
    >>
    >> On Sun. Nov, 4, at 2:00 AM DST the clocks should move back 1 hour.
    >>
    >> I have updated my linux boxes for the new times.
    >>
    >> I get correct answers for
    >> t=Time.mktime(2007,3,12)
    >> t.isdst => true
    >> t=Time.mktime(2007,11,3)
    >> t.isdst => true
    >> t=Time.mktime(2007,11,5)
    >> t.isdst => false
    >>
    >> However, On Windows XP, even though I have updated the settings
    >> for DST, Ruby 1.85 (one click installer) reports incorrectly
    >>
    >> t=Time.mktime(2007,3,12)
    >> t.isdst => false
    >> t=Time.mktime(2007,11,3)
    >> t.isdst => false
    >>
    >> Does this have something to do the machine on which ruby was compiled?
    >> Or does it have some other cause?

    >
    > This has to do with the systemwide timezone database on the system where
    > ruby is running. It appears that Linux has been updated for this for a
    > good long time (i.e. since the bill was signed into law), but Windows
    > they're only just starting to patch. See http://tinyurl.com/2nqdpf for the
    > fix. I'm not sure whether they're going to push this out by Windows Update
    > to you, but it's only been available for about a week now.
    >
    > Long live Linux, whose developers care about the future.
    >
    > --Ken
    >

    Actually M$ makes an update available for Windows XP and Server 2003.
    However, its an optional update not one that comes out automatically.
    TZedit will work on all versions of windows the updates provided by M$
    will only work on XP and server 2003. A lot of people are going to be
    shocked when their computers don't adjust.

    Ernie
    Ernest Ellingson, Feb 15, 2007
    #6
    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. Ryan Ternier
    Replies:
    1
    Views:
    1,458
    Ryan Ternier
    Oct 14, 2005
  2. lordy
    Replies:
    3
    Views:
    1,883
    lordy
    Jul 14, 2006
  3. js
    Replies:
    1
    Views:
    777
  4. dhanya
    Replies:
    2
    Views:
    288
    Noble
    Dec 1, 2006
  5. Washington Ratso
    Replies:
    1
    Views:
    48
    Chris “Kwpolska†Warrick
    Apr 3, 2014
Loading...

Share This Page