On Sat, 5 Apr 2003 12:05:15 +0200, [EMAIL PROTECTED] wrote:
>Joshua Hoblitt schreef:
>> When converting a DateTime::Duration month to days - how many days
>> should it be considering equivalent too? 30? 30.4? 31?
>
>If you want to do this, you have to take into account that a duration of
>$x years is translated to 12*$x years internally. If your calendar has

                                 ^^^^^ assume you mean months here

>no months, it should calculate the number of days to add as
>
>    $delta_days + int( $delta_months * $DAYS_IN_YEAR/12 );
>
>Problem with the Mayan calendar: it has no years either... But one of
>the smaller counts (haab) is 365 days long, I believe. So that is
>probably the Mayan idea of a year.
>
>(As usual) I disagree with Dave: some people would find it useful to use
>durations in any calendar, so why not implement them. As long as they
>use days and years only, there is no problem. And if they try to add a
>number of months to a Mayan date, they shouldn't complain about the
>result.

I think I wrote the part of Date::Ical that originally did the x years
=> 12*x months translation, and I repent.  A duration object should
not merge its creating parameters into just seconds, days, and months
buckets.  This is much to Gregorian-centric.

Reply via email to