On Sat, 1 Mar 2003, Bruce Van Allen wrote:

> I agree with these thoughts and principles, but thinking of months as
> discrete units also has complications, as you say, with "weird
> unpredictable results":
> # per above examples:
> 01:00 31 December 2002  + 2 months  = 01:00 31 February 2003 # NO
> # 'End of Unit' date [0]:
> 01:00 31 December 2002  + 2 months  = 01:00 28 February 2003
> # carryover -- but by what logic??
>    day of month math: 31 - 28 = 3
> 01:00 31 December 2002  + 2 months  = 01:00 03 March 2003
>    business month math: 31 December + 30 + 30
> 01:00 31 December 2002  + 2 months  = 01:00 01 March 2003

That's why there is an "eom_mode" (end of month mode) parameter for the
DateTime::Duration constructor, which allows you to control how adding
months is handled.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to