mangrove has asked for the wisdom of the Perl Monks concerning the following question:
The Date_ConvTZ function from Date::Manip is not working correctly on version 6.52 which is working fine with version 5.42
#!/usr/local/bin/perl use strict; use warnings; use POSIX; use Date::Manip; use Data::Dumper; my $now = ParseDate( "now" ); print "NOW: $now\n"; my $today = ParseDate( "-1 hour" ); print "today:$today\n"; my $npadate = UnixDate( $today, "%Y%m%d" ); #my $npahour = UnixDate( $today, "%H" ); #they want file date/time in central time............ print "TODAY II: $today\n"; my $fd = Date_ConvTZ( $today, "EST", "CST" ); print "FD: $fd\n"; my $yest = DateCalc( $fd, "-1 day" ); $yest = UnixDate( $yest, "%Y%m%d" ); print "yest:$yest\n"; my $filedate = UnixDate( $fd, "%Y%m%d" ); my $filehour = UnixDate( $fd, "%H" ); print "filedate:$filedate, filehour:$filehour\n";
output:- NOW: 2017050112:32:01 today:2017050111:32:01 TODAY II: 2017050111:32:01 FD: 2017050200:32:01 yest:20170501 filedate:20170502, filehour:00
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The funtion - Date_ConvTZ is not working correctly when converting from EST to CST
by 1nickt (Canon) on May 01, 2017 at 16:43 UTC | |
by mangrove (Acolyte) on May 01, 2017 at 19:07 UTC |