mkent has asked for the wisdom of the Perl Monks concerning the following question:
I pull time and date from a file, and separate day, month, year, hour, minute and second, then feed the variables into localtime.pl that comes with Perl. However, one of the variables keeps producing an error, even with chop and chomp used on that variable:
my $log_time = timelocal($sec,$min,$hhour,$day,$month,$year);
I'm pretty sure it's not timelocal itself, since feeding it straight numbers works fine, translating into seconds.
I thought Perl automatically selected file types, but it looks to me like it's seeing $day as a string, even though it's a number, like 15.
A web search didn't turn up anything relevant. Any ideas?
Title edit by tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: timelocal
by mojotoad (Monsignor) on Dec 20, 2002 at 18:38 UTC | |
|
Re: Error from timelocal
by jonnyfolk (Vicar) on Dec 20, 2002 at 20:14 UTC | |
by logan (Curate) on Dec 20, 2002 at 21:48 UTC | |
by jonnyfolk (Vicar) on Dec 21, 2002 at 09:42 UTC | |
by mkent (Acolyte) on Dec 28, 2002 at 20:33 UTC | |
by jonnyfolk (Vicar) on Dec 29, 2002 at 10:28 UTC | |
|
Re: Error from timelocal
by CountZero (Bishop) on Dec 20, 2002 at 19:48 UTC | |
|
Re: timelocal
by fglock (Vicar) on Dec 20, 2002 at 19:06 UTC | |
by MarkM (Curate) on Dec 20, 2002 at 19:46 UTC | |
|
Re: Error from timelocal
by logan (Curate) on Dec 20, 2002 at 19:51 UTC | |
|
Re: Error from timelocal
by kjd (Acolyte) on Dec 20, 2002 at 23:41 UTC | |
by thezip (Vicar) on Dec 21, 2002 at 03:29 UTC | |
by bart (Canon) on Dec 21, 2002 at 10:43 UTC |