in reply to Beware Date::Calc::Add_Delta_DHMS
in thread Good & Easy Date Module?

Lemme bet the rent on this one...

You were using a time between 12 midnight and 1am as your base time, and you crossed the spring daylight savings time boundary when a day had only 23 hours. Then you'll be off a day. If this is the case, your epoch +/- 86400*7 solution will also fail, and you've only been lucky not to hit the same case.

So the problem was not Date::Calc, but in a misunderstanding that there's not always 24 hours in a day.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: Beware Date::Calc::Add_Delta_DHMS
by grinder (Bishop) on Feb 21, 2001 at 23:33 UTC
    /me is enlightened.

    I guess I shall have to go and code up my hypothesis. The only niggling thing is that I'm pretty sure the log files started from May last year, and I wrote the stuff in September. So I shouldn't have been bitten by that.

    Mind you, shouldn't Date::Calc deal with that kind of fiddly stuff for me? That's why I'm not rolling my own in the first place, no?

      Well, there's a 25-hour day in there... maybe that broke it.

      And Date::Calc is doing what you told it. If you cross the funny-days, you get surprising results only if you're not aware of it.

      -- Randal L. Schwartz, Perl hacker