How does perl get the TZ DST data in Time::Local?

Discussion in 'Perl Misc' started by cade.robinson@gmail.com, Jun 7, 2006.

  1. Guest

    I just read that in 2007 in the US that DST is changing dates.

    Looks like all computers will need a patch for the TZ data and DST
    changes.

    My question is how does perl get TZ data?
    Does it pull it from the machine?

    So for example next year between 3/11 and 4/1 what happens when you use
    Time::Local and use "timelocal" on the second past epoch?

    Normally say you have X seconds and that translates to say Mar 20th
    10:00am 2007.

    Is that going to be the correct 10:00 am or will it be an hour behind?

    If Time::Local has internal DST change tables won't that time be off?

    Thanks
    Cade
     
    , Jun 7, 2006
    #1
    1. Advertising

  2. John Bokma Guest

    wrote:

    > I just read that in 2007 in the US that DST is changing dates.
    >
    > Looks like all computers will need a patch for the TZ data and DST
    > changes.


    Yup, happened too when MS released Windows95 :-D.

    --
    John Bokma Freelance software developer
    &
    Experienced Perl programmer: http://castleamber.com/
     
    John Bokma, Jun 7, 2006
    #2
    1. Advertising

  3. Guest

    I revise this to include the "localtime" function.

    I just tested on my Debian machine by getting the the seconds now with
    "time" and then adding 276 days of seconds to it which put it at
    3/10/07 and localtime shows that it is right. Then I add another day
    and it shows that the DST offset happened.

    I also tried on a Tru64 machine and it is wrong.
    So is that perl or the OS?

    wrote:
    > I just read that in 2007 in the US that DST is changing dates.
    >
    > Looks like all computers will need a patch for the TZ data and DST
    > changes.
    >
    > My question is how does perl get TZ data?
    > Does it pull it from the machine?
    >
    > So for example next year between 3/11 and 4/1 what happens when you use
    > Time::Local and use "timelocal" on the second past epoch?
    >
    > Normally say you have X seconds and that translates to say Mar 20th
    > 10:00am 2007.
    >
    > Is that going to be the correct 10:00 am or will it be an hour behind?
    >
    > If Time::Local has internal DST change tables won't that time be off?
    >
    > Thanks
    > Cade
     
    , Jun 7, 2006
    #3
  4. Ben Morrow Guest

    Quoth :
    > I just read that in 2007 in the US that DST is changing dates.
    >
    > Looks like all computers will need a patch for the TZ data and DST
    > changes.
    >
    > My question is how does perl get TZ data?
    > Does it pull it from the machine?


    Yup, or at least, the modules I know about do :). (There's nothing to
    prevent someone from writing a TZ system in Perl, but...)

    Presumably you will need to update your tz database from somewhere, the
    procedure for which will depend on your OS (come to think of it, I don't
    know how to do it for mine... not that I care terribly much, not being
    in the US :) ).

    Ben

    --
    The cosmos, at best, is like a rubbish heap scattered at random.
    Heraclitus
     
    Ben Morrow, Jun 7, 2006
    #4
    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. js
    Replies:
    1
    Views:
    810
  2. reppisch

    time() sleep() and dst

    reppisch, Oct 27, 2006, in forum: C Programming
    Replies:
    14
    Views:
    541
    Random832
    Nov 20, 2006
  3. Roedy Green
    Replies:
    20
    Views:
    809
    Dr J R Stockton
    Oct 5, 2009
  4. Jonathan Wood
    Replies:
    1
    Views:
    2,236
    Jonathan Wood
    Nov 1, 2009
  5. Chris Shea

    Time's dst? strangeness

    Chris Shea, Apr 11, 2007, in forum: Ruby
    Replies:
    1
    Views:
    111
    Rick DeNatale
    Apr 14, 2007
Loading...

Share This Page