http://www.perlmonks.org?node_id=970975

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.