Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^4: Adding to a date using Time::localtime

by scorpio17 (Monsignor)
on Feb 21, 2007 at 21:19 UTC ( #601430=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Adding to a date using Time::localtime
in thread Adding to a date using Time::localtime

I think he means that if the 14 day interval happens to span the day that daylight-savings-time goes 'on' or 'off', then there will be an error (time difference) of one hour. Hypothetically, if you did this calculation around midnight of the day DST kicked in, you might get the wrong result...


Comment on Re^4: Adding to a date using Time::localtime
Re^5: Adding to a date using Time::localtime
by ikegami (Pope) on Feb 21, 2007 at 21:24 UTC

    there will be an error (time difference) of one hour.

    Not quite. The result is sometimes a day off. There are no hours in the output, so I don't know how it can be an hour off.

    During one hour of the year, the returned date will be only 13 days away, and
    during another hour of the year, the returned date will be 15 days away.

      Right - I should have said, "there will be an error of one hour in the computed 14 day offset. That is, when you convert 14 days into seconds, it might off by +/-1 hour depending on DST. This will, in turn, cause the final result to be off by a day, as you said.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://601430]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (12)
As of 2014-09-30 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (381 votes), past polls