Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am getting a date input from a csv file, which i want to check each date with current date, and if older than 1 month, i can do some operation on it for that entry.
I am not allowed to install extra libs so, i am not using Date::Calc and have to somehow stick to Time::Local.
Here is the snippet of my code, and suggest where I am going wrong.
Code :
if (my ($inpmm, $inpdd, $inpyyyy) = @date[1] =~ '(\d+)/(\d+)/(\d+)') { { print "@date[1] : Has been split to $certyyyy, $certmm, $certdd"; my @certdate=(0, 1, 1, $certdd, $certmm-1, $certyyyy); print "---@certdate"; # Just to see how it gets formed my $inptime=timelocal_nocheck(@certdate); print "<td>$inptime</td>"; my $timediff=$inptime - $lmtime; print "$timediff"; if ($timediff <= 2628000) { <<Go with Job>> } else { <<Skip Job>> } } else { print "Not in Format" }
Output
08/12/2016 : Has been split to 2016, 08, 12---0 1 1 12 7 2016
After this, it ubruptly ends, even when i have some 100 odd entries to go.
Thanks a lot in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: timelocal error wired behaviour
by Discipulus (Canon) on Sep 30, 2014 at 07:07 UTC | |
|
Re: timelocal error weird behaviour
by hippo (Archbishop) on Sep 30, 2014 at 10:09 UTC | |
|
Re: timelocal error wired behaviour
by CountZero (Bishop) on Sep 30, 2014 at 13:28 UTC |