Manage Learn to apply best practices and optimize your operations.

Calculate Difference Of Two Given Time In Hours

The following fomula may be used to calculate the difference
between two times in hours when given a starting and ending
time and date. Used fields in the formulas explained as below :

FIELDS
StartDate = Date when project started. Field is a date field
restricted to date only.
StartTime = Represents starting time. Field is a number. Format
for time is 930 for 9:30am
EndDate = Represents Ending Date. Field is a date field restricted
to date only.
EndTime = Represents ending time. Field is a number. Format for
time is 1450 for 2:50pm

NOTE: The reason for dividing by 60x60x24 is that when you do any
math on Notes dates, it will transforms them to seconds. To convert
them back to hours, you must divide by
seconds x minutes x hours in a day = 60x60x24 = 86400

Hiren Purohit
25, SankalpSociety, Ghod Dod Road, Surat, 395 001, India
temp:=@If(EndTime&LT1000"0"+@Text(EndTime);@Text(EndTime));
temp1:=@Left(temp;2)+":"+@Right(temp;2);
temp2:=@TextToTime(@Text(@Date(EndDate))+" "+@Text(temp1));
temp3:=@If(StartTime&LT1000"0"+@Text(StartTime);@Text(StartTime));
temp4:=@Left(temp3;2)+":"+@Right(temp3;2);
temp5:=@TextToTime(@Text(@Date(StartDate))
+" "+@Text(temp4));
(temp2 - temp5) / (86400 * 24)

Dig Deeper on Domino Resources - Part 2

Start the conversation

Send me notifications when other members comment.

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

SearchDataCenter

SearchContentManagement

Close