in reply to Re: Error while using "timelocal ()" function.
in thread Error while using "timelocal ()" function.

What was the issue with timelocal()?
Can you please share your solution?

I am getting the same error(Day '' out of range 1..31 script.pl at line2 ), but finding to hard to find the solution?

Code snippet:

use Time::Local; my $time = timegm( $sec, $min, $hours, $mday, $mon, $year );
Thanks.

Replies are listed 'Best First'.
Re^3: Error while using "timelocal ()" function.
by Corion (Patriarch) on Aug 25, 2021 at 08:11 UTC

    Have you looked at what value you are passing to timegm()?

    Most likely, $mday is empty for some reason, as the error message tells you.