Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Using Time::Piece Strptime

by Mr. Muskrat (Canon)
on Jan 25, 2016 at 22:19 UTC ( [id://1153618]=note: print w/replies, xml ) Need Help??


in reply to Using Time::Piece Strptime

It's giving you as much info as you gave it to use.

'%D' is a shortcut for '%m/%d/%y'. '%M' is the minute as a decimal (0-59). '%b' is abbreviated month name. '%Y' is the year with century as a decimal. See man strptime.

# derived from your post my $date = '3/11/16, 00, Mar, 2016'; $date1 = Time::Piece->strptime($date, '%D, %M, %b, %Y'); print "'$date' parses to '$date1'\n"; __END__ '3/11/16, 0, Mar, 2016' parses as 'Fri Mar 11 00:00:00 2016'

Update: Fixed print and added output.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (1)
As of 2024-04-25 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found