Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

module for days conversion

by live4tech (Sexton)
on May 17, 2012 at 04:27 UTC ( #970975=perlquestion: print w/replies, xml ) Need Help??

live4tech has asked for the wisdom of the Perl Monks concerning the following question:

Hello. Does anyone know about a CPAN module I could use to convert a number of days to ( years months days hours ). I could do this manually by dividing down and using modulus, but using a module seems more Perlish to me.

Replies are listed 'Best First'.
Re: module for days conversion
by sauoq (Abbot) on May 17, 2012 at 05:35 UTC
    I could do this manually by dividing down and using modulus

    You may be able to do what you want with Date::Calc. If not, you almost certainly could with Date::Manip::Delta.

    When you aren't dealing with specific dates, you run into problems which might not be obvious at first. How many months is 3100 days? Or how many days is 3 months?

    -sauoq
    "My two cents aren't worth a dime.";
      Thanks, this was helpful!
Re: module for days conversion
by Anonymous Monk on May 17, 2012 at 11:16 UTC
    Programming is no longer a "do it yourself" enterprise. Today, you look for an existing solution ... and you find it.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2022-11-30 23:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?