diffdays

peter.fink at tiscali.ch peter.fink at tiscali.ch
Wed Jul 17 19:38:00 EDT 2002


sims

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 same happens with the long system date and similarly with short and
long dates.

another question comes to mind: what do you expect as the correct number
of days between 1900 and 2002, including switching days (Schalttage)? 37253,37254,37255,37256,...?

Peter

>
>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.
>
>sims
>
>on mouseUp
>   put "7/17/1900" into DateA
>   convert DateA from  short date to seconds
>   put "7/17/2002" into DateB
>   convert DateB from short date to seconds
>   put DateA - DateB into diff
>   divide diff by 86400 -- No of seconds in 1 day
>   if char 1 of diff = "-" then delete char 1 of diff
>   put diff
>end mouseUp
>
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>http://lists.runrev.com/mailman/listinfo/use-revolution










More information about the Use-livecode mailing list