Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I was hoping a more experienced person can direct me what I am doing wrong on this NT script??Day '' out of range 1..31 at C:\Perl\bin\timr3.pl line 29
use Time::Local; my %month_num = ( Jan => 0, Feb => 1, Mar => 2, Apr => 3, May => 4, Jun => 5, Jul => 6, Aug => 7, Sep => 8, Oct => 9, Nov => 10, Dec => 11, ); sub get_seconds { my ($date, $time) = @_; my ($day, $mon, $yr) = split /\//, $date; my ($hr, $min, $sec) = split /:/, $time; $mon = $month_num{$mon}; $yr = $yr - 1900; my $data = timelocal($sec, $min, $hr, $day, $mon, $yr); print "$data\n"; } &get_seconds;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting Time to work
by grinder (Bishop) on Aug 06, 2002 at 14:34 UTC | |
|
Re: Getting Time to work
by arturo (Vicar) on Aug 06, 2002 at 14:29 UTC | |
|
Re: Getting Time to work
by demerphq (Chancellor) on Aug 06, 2002 at 15:41 UTC |