Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Timelocal out of range message

by vinoth.ree (Parson)
on Jan 29, 2014 at 07:40 UTC ( #1072456=note: print w/ replies, xml ) Need Help??


in reply to Timelocal out of range message

Corion++

You will see that Months are set in an array:

my @MonthDays = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);  

Therefore, when it tries to pull the number of days for the month you passed to it, it's searching it's index from 0 to 11. So when you pass in your Month as 1 (Feb), it's searching the array and thinking only 28 days are avilable and failing when you specify 29 since you are technically 'out of range'.


All is well


Comment on Re: Timelocal out of range message
Download Code
Re^2: Timelocal out of range message
by itis.guptak (Initiate) on Feb 03, 2014 at 05:39 UTC
    my @MonthDays = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

    So does that mean 29 is being passed as the day of the month for Feb? I see nowhere in the script that the day of the month is passed to timelocal. Is there any way we can control this for Feb (along with a leap year)?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (17)
As of 2014-09-02 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (22 votes), past polls