Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: add/subtract with date!

From: holger:rebol at: 14-Nov-2000 9:17

On Tue, Nov 14, 2000 at 08:55:19AM -0700, Russell Yost wrote:
> Curiouser and curiouser! > > A console session: > > >> today: now > == 14-Nov-2000/8:37:21-7:00 > >> today/month: now/month + 15 > == 26 ; oops! but -- > >> today > == 14-Feb-2002/8:37:21-7:00 ; somehow, the error was corrected! But let's > try again: > >> today/month: now/month + 15 > == 26 > >> today > == 14-Feb-2004/8:37:21-7:00 > >> > > So far I haven't figured out how this happens!
Looks like correct behavior. In the second example before you change the month the year is 2002. Then you set the month to "November + 15 months", i.e. REBOL normalizes the date to "November + 15 months + year 2002" and correctly ends up with February 2004. -- Holger Kruse [holger--rebol--com]