[REBOL] Re: Date/Time Difference - Feature or Bug?
From: gjones05:mail:orion at: 11-May-2001 17:36
From: "Ladislav Mecir"
> > While working with date/time(s) in REBOL between time zones, I
noticed
> > what seems to be an unexpected result.
> >
> > t1: 11-May-2001/13:08:52-5:00
> > t2: 11-May-2001/13:08:52-7:00
> > t1/time - t2/time ; result 0:00 ... because of path refinement, ok
> > t1/zone - t2/zone ; result 2:00 ... ok
> > t1 - t2 ; result 0 ... hmmm
> > equal? t1 t2 ; result false ... ok
> >
> > Given the GMT offset, it seems as though the calculation t1 - t2
should
> > give a 2 hour difference. Am I missing something obvious?
> > --Scott Jones
> >
>
> See this:
>
> t1: 11-May-2001/13:08:52-5:00
> t2: 10-May-2001/15:08:52-5:00
> t1 - t2 ; == 1
>
> The meaning: t1 - t2 is the number of days between two dates.
>
> Moreover:
> t1: 11-May-2001/13:08:52-5:00
> t2: 11-May-2001/13:08:52-7:00
>
> t1 < t2 ; == true
>
> Regards
> Ladislav
Well, the final comparison (t1 < t2 ; == true) is reassuring, and (type?
t1) does return date!. But it still seems inconsistent when the
interpreter recognizes one as being less than the other, but the
difference is computed as 0.
I genuinely appreciate your response. Of course the "problem" is easily
worked with (around), it just surprised me. Thanks!
--Scott Jones