Skip Menu |

This queue is for tickets about the Time-Piece CPAN distribution.

Report information
The Basics
Id: 122092
Status: resolved
Priority: 0/
Queue: Time-Piece

People
Owner: Nobody in particular
Requestors: ludovic [...] bcs.org
Cc:
AdminCc:

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



Subject: strptime bug: %F unimplemented
Date: Wed, 14 Jun 2017 12:07:35 +0100
To: bug-Time-Piece [...] rt.cpan.org
From: Ludovic Tolhurst-Cleaver <ludovic [...] bcs.org>
Time::Piece (as noted in another bug report) claims to follow BSD's strptime and strftime utilities, but it doesn't entirely. %F is unimplemented. The BSD standard says that it should equate to "%Y-%m-%d". Try the following two one-liners: perl -MTime::Piece -E '$str = "2017-06-14"; my $t = Time::Piece->strptime($str, "%F"); say $t' perl -MTime::Piece -E '$str = "2017-06-14"; my $t = Time::Piece->strptime($str, "%Y-%m-%d"); say $t' The first warns "garbage at end of string in strptime: 2017-06-14" and sets $t to Thu Jan 1 00:00:00 1970. The second succeeds. Please do implement %F ! Thanks. -- Ludovic Tolhurst-Cleaver
On Wed Jun 14 07:08:06 2017, ludovic@bcs.org wrote: Show quoted text
> Time::Piece (as noted in another bug report) claims to follow BSD's > strptime and strftime utilities, but it doesn't entirely. > > %F is unimplemented. The BSD standard says that it should equate to > "%Y-%m-%d". Try the following two one-liners: > > perl -MTime::Piece -E '$str = "2017-06-14"; my $t = > Time::Piece->strptime($str, "%F"); say $t' > perl -MTime::Piece -E '$str = "2017-06-14"; my $t = > Time::Piece->strptime($str, "%Y-%m-%d"); say $t' > > The first warns "garbage at end of string in strptime: 2017-06-14" and sets > $t to Thu Jan 1 00:00:00 1970. > The second succeeds. > > Please do implement %F ! > Thanks. >
Hi, This should be fixed in 1.31_03 Regards, Samuel Smith