[futurebasic] Re: [FB] Re:Subtacting one date from another

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2002 : Group Archive : Group : All Groups

From: Alain Pastor <pixmix@...>
Date: Sat, 14 Sep 2002 18:24:41 +0200

Stewart Harris wrote:
> Could some one tell me how to get the difference in days between two dates?
> 
> Thanks fo the help.
> 

I would try this:

_secsPerDay = 60*60*24

Dim As DateTimeRec     date1, date2
Dim As Unsigned Long @ t1, t2

date1.year  = 2002
date1.month = 1
date1.day   = 1

date2.year  = 2003
date2.month = 1
date2.day   = 1

DateToSeconds( date1, t1 )
DateToSeconds( date2, t2 )

Print Abs( (t2-t1)/_secsPerDay )" days"


-- 
Cheers,

A. Pastor