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>
Download (untitled) / with headers
text/plain 712b
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>>
Download Strptime.pm
text/x-perl 41.4k

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

Download (untitled) / with headers
text/plain 148b
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/


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.