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: 14422
Status: rejected
Priority: 0/
Queue: DateTime-Format-Strptime

People
Owner: Nobody in particular
Requestors: DSimonetta [...] glasshouse.com
Cc:
AdminCc:

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



Subject: DateTime::Format::Strptime 1.0601 bug converting %s
Date: Fri, 2 Sep 2005 17:11:09 +0100
From: "Don Simonetta" <DSimonetta [...] glasshouse.com>
To: <bug-datetime-format-strptime [...] rt.cpan.org>
CC: <datetime [...] perl.org>
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>>

Message body is not shown because sender requested not to inline it.

Duplicate of #11863. Resolved in 1.0900. In future, please log bugs in the google-code project: http://code.google.com/p/datetime-format-strptime/