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

[REBOL] =?iso-8859-2?Q?Re=3A=20=5BREBOL=5D=20ANN=3A=20subtract=2Ddates?=

From: rebolek::seznam::cz at: 8-Jun-2003 18:52

??? what's wrong with
>> now - 1-1-2003
== 158 bye, bolek Dne 6. =E8erven 2003, <[rebol-list--rebol--com]> napsal:
> Hello rebol-list, > > is there any simple way how to subtract 2 dates? > I had to write this function: > > subtract-dates: func[ > "Returns the second date subtracted from the first in time! datatype." > end [date!] start [date!] > /local time days > ][ > if end < start [return negate subtract-dates end start] > time: (either none? end/time [0:0][end/time]) - (either none? start/time [0:0][start/time]) > either 0 < days: end/day - start/day [(days * 24:00) + time][ time ] > ] > > ;so for example this will return time since 1-1-2003: > subtract-dates now 1-1-2003 > > -- > Best regards, > rebOldes mailto:[rebol-list2--seznam--cz] > > -- > To unsubscribe from this list, please send an email to > [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes. >
______________________________________________________________________ Reklama: P=F8iprav se na nejp=F8=ED=B9ern=ECj=B9=ED z=E1=BEitek v =BEivot=EC na http://ad2.seznam.cz/redir.cgi?instance=46466%26url=http://www.priserky.cz