Thursday 15 September 2011

lotusscript - Lotus Notes Domino Getting Date Difference -


text after "itemprop =" text ">

I think the time difference between the two fields will be calculated using a code lotusScript, now I am between Want to calculate the difference of dates? I have started a lot and I have got minimal knowledge about it. Hope you can help me. Here is the code that I have made to calculate the time difference: Sub UpdateDuration () dims ws new notesUIWorkspace dim uidoc NotesUIDocument slow startTime NotesDateTime slow endtime NotesDateTime set the dimension integer set uidoc form As in as far as = ws.CurrentDocument then exit uidoc.FieldGetText ("StartTime") = "" (StartTime ") followed by subthifference uidoc.FieldGetText" = "" then sub Set the starttime then set StartTime = New NotesDateTime (uidoc.FieldGetText ("StartTime") set endtime = New NotesDateTime (uidoc.FieldGetText ("ENDTIME")) duration = endtime.TimeDifference (StartTime) Idoc.FieldSetText (call "duration", call cust (duration)) uidoc.Refresh () End Sub

The timer gives the number of seconds between two notesetimes. One day is 60 * 60 * 24 seconds, and it works up to 86400. So just type your code up properly and divide the result to 86400. (The only other thing you want to change is your field and variable name, to reflect the fact that you are working with date input instead of time.)

No comments:

Post a Comment