Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DateTime-Format-Strptime CPAN distribution.

Report information
The Basics
Id: 11863
Status: resolved
Priority: 0/
Queue: DateTime-Format-Strptime

People
Owner: rickm [...] cpan.org
Requestors: DSimonetta [...] glasshouse.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: bug in DateTime::Format::Strptime 1.0601 when using %s
Date: Mon, 14 Mar 2005 08:52:03 -0000
From: "Don Simonetta" <DSimonetta [...] glasshouse.com>
To: <bug-datetime-format-strptime [...] rt.cpan.org>
There is a bug in this module when dealing with seconds since epoch. The following piece of code, when run, illustrates the problem. It appears that the minutes & seconds of the final result are always set to 0. 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) = localtime($iDt); printf("Instead of %4d-%02d-%02d %02d:%02d:%02d \n", $year+1900, $month+1, $mday, $hour, $min, $sec);
Resolved in 1.0900. In future, please log bugs in the google-code project: http://code.google.com/p/datetime-format-strptime/