in reply to Re: Within A Date Time Range
in thread Within A Date Time Range

Check the documentation for Time::Local, in particular what the ranges are for year and month. From the doc:
It is worth drawing particular attention to the expected ranges for the values provided. While the day of the month is expected to be in the range 1..31, the month should be in the range 0..11. This is consistent with the values returned from localtime() and gmtime().
Note range for month is 0..11, though days are 1..31! Also, the allowed ranges for year are flexible, though not necessarily what you'd expect.

Replies are listed 'Best First'.
Re: Re: Re: Within A Date Time Range
by mumbles (Friar) on Jul 07, 2001 at 18:34 UTC

    geez...

    So all that was required was to subtract 1 from $month1 and $month2 and all is ok?! I read the module and didn't get it. I read the section in the cookbook and still didn't get it. I was even told the month range was 0..11 and I still didn't get a clue.

    I don't want to tell you how many hours I spent on this.

    Thank you very much.

    For pennance this newbie is going to whack himself over the head with all the surrounding Perl books

    BTW, this will be called from another program that pings servers and gateways every five minutes. Should a machine not respond it will check with this script to make sure that the downtime isn't scheduled before sending pages/emails etc.