Subtracy 2 dates in LS

hello all:I have this code to subtract 2 dates

thisday=Cdat(Today)—>24/03/2004

testdate=(Cdat(thisday)-doc.ReqDate(0))/8400

when debugging

doc.ReqDate(0)=[24/03/2004 5:47:38 PM]

testdate=-8.82633377425788E-05

how come it is a negative value

thanks

Dalia

Subject: subtracy 2 dates in LS

As christian says, if there is no time then LotusScript sets the time to the start of the day, which is 00:00:00 local time on the machine where the code is running.You can use the Fix function to set the other time to the start of the day too.

By the way, you do not need to use Cdat. The Today function returns a date/time value anyway.

It is not clear why you write /8400. If you subtract the dates, the result is a number of days.

days = Today - Fix(doc.ReqDate(0))

If this does not help you, please explain more about what you are really trying to achieve.

Subject: subtracy 2 dates in LS

Just from what I see is this day without time ( from my understanding this means 00:00:00)

thisday = 24/03/2004 00:00:00 AM

reqdate = 24/0372004 05:47:38 PM

then you subtract reqdate from thisday what has to be negative due reqdate is bigger.

Hope this helps. Please correct me if I am putting this guy into wrong direction.