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 first 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.

0 comments

Oldest 

Forgot Password?

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

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

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

SearchVirtualDataCentre.co.UK

Close