diffdays

peter.fink at tiscali.ch peter.fink at tiscali.ch
Thu Jul 18 03:42:01 EDT 2002


>-- Original-Nachricht --
>Subject: Re: diffdays
>From: Terry Vogelaar <terry at discovery.nl>
>To: <use-revolution at lists.runrev.com>
>Reply-To: use-revolution at lists.runrev.com
>Date: Thu, 18 Jul 2002 06:22:16 +0200
>
>
>Sims:
>> I changed it as follows but it still puts 730 days.
>> 7/17/1900  to  7/17/2002  is a bit more days than that.
>
>Peter:
>> you uncovered a bug.
>> it is easier to try the following, using Script Debug Mode.
>> 
>> on mouseUp
>>   put "17.7.1901" into dateA
>>   convert dateA from short system date to dateItems
>> end mouseUp
>> 
>> and see 2001,7,17,2,0,0,3 .
>
>The problem in both cases is that the input is not 'correct'. A short date
>has only two digits for the year: 7/17/01. Using the CenturyCutOff property,
>you can determine when you mean 1901 or 2001. Conclusion: only use a short


No, that's not the problem. There's a bug. Additionally, dateItems sets
midnight to 2 AM which is also a bug.

sims: it is not a lot of work to do the date conversion by hand. it needs
a Switching Year (Schaltjahr) algorithm for calculation of the length of
february, and a list of the length of the months (31,28,31,30,31 etc.).
You can even use the partially correct date items to do part of the parsing.

Peter









More information about the Use-livecode mailing list