in reply to Re: How can I count the days between two dates?
in thread How can I count the days between two dates?

The problem is that the duration is expressed in months (as shown below). Converting month to days is not a formatting issue. I don't see how that module would help. Am I missing something?
$VAR1 = bless( { 'seconds' => 0, 'minutes' => 0, 'end_of_month' => 'wrap', 'nanoseconds' => 0, 'days' => 0, 'months' => 13 }, 'DateTime::Duration' );

Replies are listed 'Best First'.
Re^3: How can I count the days between two dates?
by Fletch (Bishop) on Nov 05, 2008 at 13:32 UTC

    If he's specifically interested in just the number of days, then yes you're correct it's not a solution (hence the "Possibly" :). However if the actual problem is showing a duration in a hyooman friendly representation that module is capable of normalizing a duration into the smallest possible units of each (and its logic in doing so using a base date may be of use figuring out how to approach the problem if the actual number of days is the real goal; the section on normalization in the docs mentions it under "Months of unequal length").

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.