http://www.perlmonks.org?node_id=601430


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

Replies are listed 'Best First'.
Re^5: Adding to a date using Time::localtime
by ikegami (Patriarch) 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.