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:[email protected](EndTime&LT1000"0"[email protected](EndTime);@Text(EndTime));
temp1:[email protected](temp;2)+":"[email protected](temp;2);
temp2:[email protected](@Text(@Date(EndDate))+" "[email protected](temp1));
temp3:[email protected](StartTime&LT1000"0"[email protected](StartTime);@Text(StartTime));
temp4:[email protected](temp3;2)+":"[email protected](temp3;2);
temp5:[email protected](@Text(@Date(StartDate))
+" "[email protected](temp4));
(temp2 - temp5) / (86400 * 24)

#### Dig Deeper on Domino Resources - Part 2

• Favorite iSeries cheat sheets

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

Close