finni has asked for the wisdom of the Perl Monks concerning the following question:

I've emailed the author of the module, but it's possible that the problem doesn't lie in there. I'm working on a mail archiving script, that takes everything modified yesterday and stuffs it in a directory. Seems easy enough, but Date::EzDate seems to be jumping the gun by one hour.
use Date::EzDate; $now = Date::EzDate->new("feb 28 2003 10:59 PM"); $i=0; while ($i<120) { print("$now->{'epochday'}, $now->{'full'} \n"); $i++; $now->{'epochsecond'}+=1; }
Results are:
12112, Fri Feb 28, 2003 22:59:57 12112, Fri Feb 28, 2003 22:59:58 12112, Fri Feb 28, 2003 22:59:59 12113, Fri Feb 28, 2003 23:00:00 12113, Fri Feb 28, 2003 23:00:01 12113, Fri Feb 28, 2003 23:00:02
I've tried this with 'adjust for DST' turned on and off, no change. I'm running Windows 2000 SP3, ActivePerl Build 631. I've had the same results on three similarly configure machines. I've checked SuperSearch here, and the mailing lists on Activestate.com. Any ideas, or other things I could check? Maybe something not using EzDate?

Replies are listed 'Best First'.
Re: Possible bug (or my misconfiguration) in Date::EzDate 1.04?
by mikosullivan (Novice) on Mar 03, 2003 at 18:51 UTC
    Hi, I'm the author of EzDate. Yup, I've confirmed the bug. I'll be putting out the next version within a week. That patch will include the bug fix. -Miko
Re: Possible bug (or my misconfiguration) in Date::EzDate 1.04?
by Thelonius (Priest) on Mar 03, 2003 at 18:24 UTC
    It looks like a bug to me. Line 887 of EzDate.pm has a mysterious "+ 1":
    $epoch_day_offset = ( ($date{'hour'} + 1) * 60 * 60) + ($date{'min'} * 60) + $date{'sec'};
Re: Possible bug (or my misconfiguration) in Date::EzDate 1.04?
by finni (Beadle) on Mar 03, 2003 at 16:04 UTC
    Additional info: I've confirmed the same behavior on OpenBSD 3.0, perl 5.6.1
Re: Possible bug (or my misconfiguration) in Date::EzDate 1.04?
by traveler (Parson) on Mar 03, 2003 at 17:08 UTC
    I must be missing something. 10:59PM is 22:59, just as your output shows. 22:59:59 + 1 sec is 2300. Where is the jumping?

    --traveler

      The problem, as I read it, is that the epoch day advances (from 12112 to 12113) at that time, instead of one second after 23:59:59 .