Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: timelocal error when executed twice.

by almut (Canon)
on Oct 19, 2009 at 17:48 UTC ( [id://802051]=note: print w/replies, xml ) Need Help??


in reply to timelocal error when executed twice.

Don't use $y-=1900, use $y-1900 instead.  As you have it, your value will be decremented twice, yielding an invalid year the second time.  (I'm supposing you're setting $y once somewhere at the beginning — though you haven't shown it...)

P.S.: In case anyone wonders (as I did) why when the module croaks the year value is reported as 109 (though it isn't)...  that's because the module does:

... $year += 1900; croak "Cannot handle date ($sec, $min, $hour, $mday, $month, $year +)";

Replies are listed 'Best First'.
Re^2: timelocal error when executed twice.
by Anonymous Monk on Oct 19, 2009 at 17:57 UTC
    Almut ++ you're right. The '-=1900' was the problem. Thanks.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-11-12 05:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    chatterbot is...






    Results (39 votes). Check out past polls.