in reply to Date/Time Manipulation
You could use Time::Piece and Time::Seconds which are core modules in recent Perl versions.
$ perl -MTime::Piece -MTime::Seconds -Mstrict -Mwarnings -E ' my $dateStr = q{2016-05-16 10:51:07}; my $dateFmt = q{%Y-%m-%d %H:%M:%S}; my $tp = Time::Piece->strptime( $dateStr, $dateFmt ); $tp -= ONE_HOUR; say $tp->strftime( $dateFmt );' 2016-05-16 09:51:07 $
I hope this is helpful.
Cheers,
JohnGG
|
|---|