Closed p5pRT closed 10 years ago
The Time::Piece manpage documents this:
Time::Piece has a built-in strptime() function (from FreeBSD)\, allowing you incredibly flexible date parsing routines. For example:
Apart from FreeBSDs strptime not at all being flexible (I have yet to find a date format used on the internets that it can parse)\, it's also broken on netbsd and openbsd (found out via cpan-testers).
It seems Time::Piece doesn't work as documented at all - investigating the source indicates that it uses the system-provided strptime\, so there is no way to know which fornmat specifiers are supported (and working) and which aren't.
For example\, on openbsd 5.0\, strptime documents %z\, but it has no effect. I didn't investigate the netbsd failures\, but they likely share that bug.
So\, either the documentation is wrong\, or the code. Since fixing the documentation has the side effect of making strptime useless for portable applications\, it would be best if the code were fixed to match the documentation.
On Sun\, Dec 01\, 2013 at 10:30:04PM -0800\, perl@plan9.de wrote:
The Time::Piece manpage documents this:
Time::Piece has a built-in strptime() function (from FreeBSD)\, allowing you incredibly flexible date parsing routines. For example:
Apart from FreeBSDs strptime not at all being flexible (I have yet to find a date format used on the internets that it can parse)\, it's also broken on netbsd and openbsd (found out via cpan-testers).
It seems Time::Piece doesn't work as documented at all - investigating the source indicates that it uses the system-provided strptime\, so there is no way to know which fornmat specifiers are supported (and working) and which aren't.
For example\, on openbsd 5.0\, strptime documents %z\, but it has no effect. I didn't investigate the netbsd failures\, but they likely share that bug.
So\, either the documentation is wrong\, or the code. Since fixing the documentation has the side effect of making strptime useless for portable applications\, it would be best if the code were fixed to match the documentation.
The intent certainly is that it should behave as per the documentation.
Current version is 1.23. The changelog says this:
1.17 - Force all to use internal strptime then everyone gets %z even OSX users. - Finally figured out the timezone test failures on Win32 and fixed them.
which seems to be describing pretty much the problem that you're reporting here.
That was pulled into blead with this commit:
commit 90d55c29481047f2784ec1daadd553c5710e090a Author: Chris 'BinGOs' Williams \chris@​bingosnet\.co\.uk Date: Sat Jun 26 15:04:03 2010 +0100
Update Time-Piece to CPAN version 1.20
[etc]
so anything v5.14.0 and later is shipping a version that *should* be doing exactly what the docs say (and what you need from it).
The XS source code no longer references the C library strptime\, and nm confirms this on blead:
$ nm lib/auto/Time/Piece/Piece.so | grep strp 0000000000004b5f t XS_Time__Piece__strptime 00000000000020b5 t _strptime 0000000000003914 T our_strptime
compare with the version shipped with a clean v5.12.4 build:
$ nm lib/auto/Time/Piece/Piece.so | grep strp 0000000000003c6a T XS_Time__Piece__strptime U strptime@@GLIBC_2.2.5
Were the versions that you report had broken %z handling using v5.12.4 (or earlier)\, with an older version of Time::Piece? (These are machines on CPANTesters\, or machines you can access directly?)
Otherwise\, I can't figure out why you'd be seeing what you report.
Nicholas Clark
The RT System itself - Status changed from 'new' to 'open'
On Tue\, Dec 03\, 2013 at 02:07:37AM -0800\, Nicholas Clark via RT \perlbug\-followup@​perl\.org wrote:
so anything v5.14.0 and later is shipping a version that *should* be doing exactly what the docs say (and what you need from it).
Hmm\, it seems all is in order then.
Were the versions that you report had broken %z handling using v5.12.4 (or earlier)\, with an older version of Time::Piece? (These are machines on CPANTesters\, or machines you can access directly?)
The cpantester machines are older\, and while I was under the impression that my boxes had a newer perl\, they were at 12.4 or earlier\, so I guess my report is bogus and it's all fixed.
I'll upgrade Time::Piece and will report back in the unlikely case that it isn't fixed.
Sorry for the noise.
-- The choice of a Deliantra\, the free code+content MORPG -----==- _GNU_ http://www.deliantra.net ----==-- _ generation ---==---(_)__ __ ____ __ Marc Lehmann --==---/ / _ \/ // /\ \/ / schmorp@schmorp.de -=====/_/_//_/\_\,_/ /_/\_\
On Wed Dec 04 11:08:44 2013\, schmorp@schmorp.de wrote:
On Tue\, Dec 03\, 2013 at 02:07:37AM -0800\, Nicholas Clark via RT \perlbug\-followup@​perl\.org wrote:
so anything v5.14.0 and later is shipping a version that *should* be doing exactly what the docs say (and what you need from it).
Hmm\, it seems all is in order then.
Were the versions that you report had broken %z handling using v5.12.4 (or earlier)\, with an older version of Time::Piece? (These are machines on CPANTesters\, or machines you can access directly?)
The cpantester machines are older\, and while I was under the impression that my boxes had a newer perl\, they were at 12.4 or earlier\, so I guess my report is bogus and it's all fixed.
I'll upgrade Time::Piece and will report back in the unlikely case that it isn't fixed.
Sorry for the noise.
It appears this issue is resolved. I'll take the ticket for the purpose of closing it within 7 days. If anyone thinks the ticket should stay open\, please let us know.
Thank you very much. Jim Keenan
On Tue Dec 10 16:13:37 2013\, jkeenan wrote:
It appears this issue is resolved. I'll take the ticket for the purpose of closing it within 7 days. If anyone thinks the ticket should stay open\, please let us know.
Thank you very much. Jim Keenan
Closing as per schedule.
@jkeenan - Status changed from 'open' to 'rejected'
Migrated from rt.perl.org#120655 (status was 'rejected')
Searchable as RT120655$