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

[REBOL] Re: add/subtract with date!

From: t_degrav:rhrk:uni-kl at: 14-Nov-2000 19:00

Hi Russel, maybe I have the explanation: When you think of date as having the three components day, month and year you don't directly change the whole date with "today/month: now/month + 15" but only the month! So you get 14-26-2000, which means more or less the 14th day of the 26 month(!) of the year 2000. Rebol recognizes that this isn't a valid date, but is able to calculate a corresponding date: 14-2-2002. If you now repeat "today/month: now/month + 15" you first get 14-26-2002. This is then transformed to 14-2-2004. Maybe you confused yourself a little by mixing today and now? Try today/month: today/month + 15, then you get the result you possibly expected, the date increases exactly 15 months. This maybe confusing at first but comes in rather handy when you want to add a certain amount of months instead of days. The only thing I miss is the automatic conversion of negative month values to preceding years. Tom Russell Yost wrote: