how to find difference of minutes between 2 time parameter.
For example i have StartTime: 6:00 PM, and EndTime: 7:30PM.
Discussion posts and replies are publicly visible
This is a good use case for a strong helper rule that can handle various similar use cases. Years ago I created a rule that will calculate the elapsed seconds between any two DateTime rule inputs. You can then calculate the minutes from this by dividing the result by 60 and rounding to whatever level of specificity you require.
/* rule!GLBL_CalculateElapsedSeconds */
/* ri!startTime and ri!endTime are both DateTime type */
local!days: tointeger(ri!endTime - ri!startTime),
local!hours: hour(ri!endTime - ri!startTime),
local!minutes: minute(ri!endTime - ri!startTime),
local!seconds: second(ri!endTime - ri!startTime),
local!days = 0,
local!days * 24 * 60 * 60
local!hours = 0,
local!hours * 60 * 60
local!minutes = 0,
local!minutes * 60
( Note: no need to @ me that the above code could be condensed / tightened up quite a bit... i wrote it a few years ago and have left it overly verbose for the purposes of ease of understanding - at least that's my official excuse ;-) )
© 2021 Appian. All rights reserved.