The following code snippet demonstrates a bug in version 1.0601. The problem is 
that the minutes & seconds are truncated to 0 when converting from epoch time. 
I have attached a patch for this.

        use strict;
        use DateTime::Format::Strptime;

        my $iDt = time;

        my $Strp = new DateTime::Format::Strptime(pattern => '%s');

        my $dt = $Strp->parse_datetime($iDt);


        print "converted $iDt to " .
              DateTime::Format::Strptime::strftime("%Y-%m-%d %H:%M:%S", $dt) .
              "\n";

        my($sec,$min,$hour,$mday,$month,$year);
        ($sec,$min,$hour,$mday,$month,$year,undef) = gmtime($iDt);
        printf("Instead of GMT: %4d-%02d-%02d %02d:%02d:%02d \n",
                          $year+1900, $month+1, $mday, $hour, $min, $sec);


 <<Strptime.pm>> 

Attachment: Strptime.pm
Description: Strptime.pm

Reply via email to