Time difference

Hi,I have one datetime field show only time in 24 hrs format.In Lotus script I used a variable contain a specific value 23:59 and i want to get the time difference between (23:59- datetime field value).

how can we get

thanx

Subject: RE: Time difference

The format of the field is irrelevant. That’s just how it’s displayed. The value is really a number behind the scenes.

Specifying a constant time value in your code has to be done carefully, because if the value is text, different workstations and servers format date/times differently. Even if it works on your machine it may not work on everybody’s. So you must specify the time as a set of numbers, e.g.

endTime = TimeNumber ( 23 , 59 , 0 )

However, bear in mind that some time zones have daylight saving time, so on some days, there is an hour added or inserted, so if you just subtract times without knowing the dates, you can get the wrong answer. It might not matter for your application, but I thought I should mention it.

If you are still having error, you must post your code and say what the error is.

Subject: Time difference

this might help you…Dim ws As New NotesUIWorkspace

        Dim doc As NotesDocument

        Dim starttime As NotesDateTime

        Dim endtime As NotesDateTime  

        Dim temp As Long

        Set doc=ws.CurrentDocument.Document

      ' StartTime is a date/time field selected to show time    in  24 hrs format

        Set StartTime=New NotesDateTime(doc.StartTime(0))

        Msgbox starttime.TimeOnly

        Set endtime=New NotesDateTime("23:59")

        Msgbox endtime.TimeOnly

        temp= endtime.TimeDifference(starttime)

        ' gives u num of hrs

        Msgbox temp/3600

Subject: Time difference

Look at NotesDateTime.TimeDifference in Designer help.

/Peter

Subject: RE: Time difference

ok.I used it but how can i pass specific value 23:59 it gives error.please tell me in details