> > I'd say that the same applies .. add one month:
> > 01:00 26 January 2003  + 1 month  = 01:00 26 February 2003
> > 01:00 26 February 2003 + 2 months = 01:00 26 April 2003
>
> Hmm, I'm sure there are cases where people want the other implementation,
> though.
>

I think that arises from fuzzy thinking.  Lots of people assume that date
units are reducable to seconds (I think influenced by years of working
with epoch seconds), but reducing discrete units like months, weeks, and
days to their time components is always going to produce weird
unpredictable results.

If they want to add the equivalent of 30 days in seconds vs. 1 month let
them do that, we could even provide some constants like SECS_IN_DAY to
make it easier.

I think like the earlier rule of thumb about dates start at 1, times start
at 0, it would be good rule of thumb that when adding date components the
time stays the same.

kellan

Reply via email to