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


In reply to The funtion - Date_ConvTZ is not working correctly when converting from EST to CST by mangrove

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.