Q
Problem solve Get help with specific problems with your technologies, process and projects.

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>

Dig Deeper on LotusScript

SearchWindowsServer

Search400

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/Search400.com community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury

SearchDataCenter

SearchContentManagement

Close