Q

Calculate elapsed time in minutes

I need to calculate the elapsed time in minutes. (Eg:Start Time - 2:30PM End Time - 5:30PM, Elapsed Time= 180 minutes) How can I achieve this? Thank you.


<DAVECOMMENT>You can do it fairly easily in either the formula language or LotusScript. I have included a simple example, using time constants in both languages. Good Luck!

<START FORMULA EXAMPLE>
Time1:=[08:00:01];
Time2:=[10:00:01];
Time3:=Time2-Time1;
@Prompt([OK];"Test A";@Text(Time3));
@Prompt([OK];"Test A";@Text(Time3/60))
<END FORMULA EXAMPLE>

When you subtract date/time values, the resultant value is the time difference in seconds. Simply divide this number by 60 to get the minutes.

<START LS EXAMPLE>
	Dim ndtTime1 As New NotesDateTime("08:00:00")
	Dim ndtTime2 As New NotesDateTime("10:00:00")
	Dim lngTimeDiff As Long
	Dim intMinutes As Integer
	intMinutes=60
	lngTimeDiff=ndtTime2.TimeDifference(ndtTime1)
	Print lngTimeDiff/intMinutes
<END LS EXAMPLE>

This was last published in December 2001

Dig Deeper on LotusScript

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close