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

Re^2: Time Piece Error Parsing

by Anonymous Monk
on Mar 09, 2016 at 18:07 UTC ( #1157199=note: print w/replies, xml ) Need Help??


in reply to Re: Time Piece Error Parsing
in thread Time Piece Error Parsing

Interesting, so this should work even if the month has two digits.:
$date = $t->strptime(sprintf("%02d",$t->mon).sprintf("%02d",$t->day_of +_month).$t->year, '%m%d%Y');

Replies are listed 'Best First'.
Re^3: Time Piece Error Parsing
by runrig (Abbot) on Apr 15, 2016 at 15:58 UTC
    Alternatively:
    $date = $t->strptime(sprintf("%02d%02d%04d",$t->mon,$t->day_of_month,$ +t->year), '%m%d%Y');

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2019-06-17 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (80 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!