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

I've been trying to use Date::Calc module and have
succeded with some basic stuff but now have a
question I hope someone can help me with:

Having converted by using Date_to_Days eg today's
date converts to 731157, how can I reconvert
731157 to find the date?

I'm sure the answer is in the module documentation,
though I' ve had a look through
and can't find that information.

I'd be grateful for some help with this.

Thanks.

Replies are listed 'Best First'.
Re: Date::Calc question
by LTjake (Prior) on Nov 02, 2002 at 23:29 UTC
    According to the docs:

    ...In order to convert the number returned by this function back into a date, use the function "Add_Delta_Days()" described further below), as follows:
    $days = Date_to_Days($year,$month,$day); ($year,$month,$day) = Add_Delta_Days(1,1,1, $days - 1);


    --
    Rock is dead. Long live paper and scissors!
      Well that was plain enough!
      Thanks very much for your help - I promise to get to the opticians first thing Monday! :)
Re: Date::Calc question
by Aristotle (Chancellor) on Nov 02, 2002 at 23:42 UTC
    Says the documentation:
    In order to convert the number returned by this function back into a date, use the function "Add_Delta_Days()" (described further below), as follows:
    $days = Date_to_Days($year,$month,$day); ($year,$month,$day) = Add_Delta_Days(1,1,1, $days - 1);

    Makeshifts last the longest.