date/time field in Lotus Notes

315 pts.
Tags:
Lotus Notes
Lotus Notes 5.x
Hi All,

Can anybody please help me on this.

--- I have got two time fields. Time 1 and Time2.

    How can I compare both of these field in Lotus script ( not in forumula lanuguage).

Regards,

Answer Wiki

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

Not really sure what you want to compare, but here’s some code that’s straight from the Designer’s Help file, under “Examples: NotesDateTime Class”

5. This agent gets the value of the PurgeDate item in a document and places it into a NotesDateTime object. The time zone setting of PurgeDate is preserved. For example, if PurgeDate has a value of 03/21/96 04:54:33 PM in Eastern Standard Time, the DateTime object represents 03/21/96 04:54:33 PM and its TimeZone property equals 5.
Sub Initialize
Dim session As New NotesSession
Dim doc As NotesDocument
Dim item As NotesItem
Dim dt As NotesDateTime
Set doc = session.DocumentContext
Set item = doc.GetFirstItem(“PurgeDate”)
Set dt = item.DateTimeValue
Messagebox dt.LocalTime & ” TZ” & dt.TimeZone,, “Local time”
End Sub

Combine the concepts from the above with the use of the .TimeDifference or .TimeDifferenceDouble methods of the class (also explained in the Designer’s Help file), and you should be able to do what you want.

Basically,
diff = td1.TimeDifference( td2 )

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
  • Ledlincoln
    ...and it can be as simple as difference = Now - doc.MyDateField(0) or difference = Now - doc.Created Then, Msgbox difference will reveal the number of days in the integer part of the result, and the fraction of a day to the right of the decimal.
    1,620 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