Calculating the difference between two dates in LotusScript

346080 pts.
Tags:
LotusScript
How would I be able to calculate the difference between two dates in LotusScript (Say for an example: 8/6/2014 - 10/6/2014)? Thanks so much.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Dim Date1 As New NotesDateTime (“08.06.2014 00:00:00″)
Dim Date2 As New NotesDateTime (“10.06.2014 00:00:00″)
Dim difference_s As Double
Dim difference_m As Double
Dim difference_h As Double
Dim difference_d As Double

difference_s = Date2.Timedifferencedouble(Date1)
Print “Difference in seconds: ” & difference_s

difference_m = difference_s / 60
Print “Difference in minutes: ” & difference_m

difference_h = difference_m / 60
Print “Difference in hours: ” & difference_h

difference_d = difference_h / 24
Print “Difference in days: ” & difference_d

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Stiletto
    Have you tried just subtracting the one date from the other?  I think you get an answer in seconds, which you can then divide by 86400 to get days.  There are also the TimeDifference and TimeDifferenceDouble methods of the NotesDateTime class.
    3,830 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following