Time Difference Formula in LotusScript **inside body email**

Hi there

I have a form with some dates in a field called “Date1”. Too, Ive been building an agent to send some emails regarding this date. In my agent “Date” is the server date.

I would like to create a code to write in the body email whats the timedifference in days between Date1 and Date, everytime than agent runs.

As Im a rookie on Lotus Script Design, Im building this agent since 1 month ago with the help of all of you. I think this seems a easy question, but please help me.

Subject: Time Difference Formula in LotusScript inside body email

closedate = Datevalue(doc.Date1(0))serverdate = Datevalue(Now)

diff = closedate - serverdate

maildoc.Form=“Memo”

maildoc.SendTo= "user"

Set rtitem = New NotesRichTextItem(maildoc,"Body")

Call rtitem.AppendText(Chr(10) + Chr(13) + diff

Call maildoc.Send( True)

Subject: RE: Time Difference Formula in LotusScript inside body email

Thanks very much !

Look my line

Call rtitem.AppendText("Since " + diff + " days ago, “+ doc.ResponsableA(0) + " have a pending activity…blabla”)

:slight_smile:

Subject: The line diff = closedate - serverdate gives an answer in seconds…

so:diffdays = (closedate - serverdate) / 86400

Subject: RE: The line diff = closedate - serverdate gives an answer in seconds…

WEIRD…is calculating fine days without /86400

Date server is D/M/Y

Why?

Subject: Sorry. Was thinking NotesDateTime.TimeDifference which does seconds. Also…

in Formula language the difference is in Seconds. Forgot the LS version was in days.