Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Error parsing using Time::Piece

by jeffa (Bishop)
on Apr 28, 2015 at 18:43 UTC ( [id://1125043]=note: print w/replies, xml ) Need Help??


in reply to Error parsing using Time::Piece

Dealing with these parsing errors can be very painful. It seems to me that %F is not being respected. Consider the following:

$ perl -MTime::Piece -le 'print Time::Piece->strptime( "2015-04-28T11: +33:12", "%Y-%m-%dT%H:%M:%S" )' Tue Apr 28 11:33:12 2015 $ perl -MTime::Piece -le 'print Time::Piece->strptime( "2015-04-28T11: +33:12", "%Y-%m-%dT%T" )' Tue Apr 28 11:33:12 2015 $ perl -MTime::Piece -le 'print Time::Piece->strptime( "2015-04-28T11: +33:12", "%FT%H:%M:%S" )' Error parsing time ...

Why don't you change your format string to "%Y-%m-%dT%T" and see if that works? (It did for me using Time::Piece v1.29.)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1125043]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2024-04-23 12:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found