Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: DateTime::Format::Strptime - strftime formats not working?

by pc88mxer (Vicar)
on Jul 10, 2008 at 17:27 UTC ( [id://696759]=note: print w/replies, xml ) Need Help??


in reply to DateTime::Format::Strptime - strftime formats not working?

I haven't looked at the code, but testing indicates the following are probably true:

1) %g and %G do not seems to be recognized as year formats; only %y and %Y seem to work. I think %g and %G are meant to be used in conjunction with ISO 8601 week numbers (e.g. %V).

2) adding a space helps a lot - otherwise only a single year digit works:

$date = "05Jul 08"; # work with pattern => "%d%b %y" $date = "05Jul8"; # works with pattern => "%d%b%y"

Replies are listed 'Best First'.
Re^2: DateTime::Format::Strptime - strftime formats not working?
by initself (Monk) on Jul 10, 2008 at 22:57 UTC
    I wonder why zero-filled date values are not accepted. I guess these formats come from old C libraries (and are therefore not easily improved upon)? Thanks for your help, I'm all set now!

Log In?
Username:
Password:

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

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

    No recent polls found