Currently, there is no available business function to get time difference. The following event rules logic can be considered :
- Convert Input TimeA from HHMMSS into Seconds (Time A)
- Convert TimeA from HHMMSS into Seconds (Time B)
- Subtract A to B to calculate time Between
- Convert Seconds to HHMMSS format
Parameters:
- (IN) FC_mnTime_A
- (IN) FC_mnTime_B
- (OUT) FC_mnTime_BetweenTime_Seconds
- (OUT) FC_mnTime_BetweenTime_HHMMSS
Possible Implementation:
1. Convert TimeA from HHMMSS into Seconds (Time A)
If FCmnTimeA is not equal to <Blank>
Or FCmnTimeA is not equal to <NULL>
VA evtmnHours01 = ([FCmnTimeA]/10000)-(mod([FCmnTimeA],10000)/10000)
VA evtmnMinSec01 = mod([FCmnTimeA],10000)
VA evtmnMinutes01 = ([VA evtmnMinSec01]/100)-(mod([VA evtmnMinSec01],100)/100)
VA evtmnSeconds01 = [VA evtmnMinSec01]-([VA evtmnMinutes01]100)
VA evt_mnTimeInSeconds01 = ((([VA evt_mnHours01]60)60)+([VA evt_mnMinutes01]60))+[VA evt_mnSeconds01]
End If
- Convert TimeA from HHMMSS into Seconds (Time B)
If FCmnTimeB is not equal to <Blank>
Or FCmnTimeB is not equal to <NULL>
VA evtmnHours02 = ([FCmnTimeB]/10000)-(mod([FCmnTimeB],10000)/10000)
VA evtmnMinSec02 = mod([FCmnTimeB],10000)
VA evtmnMinutes02 = ([VA evtmnMinSec02]/100)-(mod([VA evtmnMinSec02],100)/100)
VA evtmnSeconds02 = [VA evtmnMinSec02]-([VA evtmnMinutes02]100)
VA evt_mnTimeInSeconds02 = ((([VA evt_mnHours02]60)60)+([VA evt_mnMinutes02]60))+[VA evt_mnSeconds02]
End If
-
Subtract from A to B to calculate time between
FCmnTimeBetweenTimeSeconds = abs(([VA evtmnTimeInSeconds01]-[VA evt_mnTimeInSeconds02])) -
Convert Seconds to HHMMSS format
VA evtmnSecondsOutput = mod([FCmnTimeBetweenTimeSeconds],60)
VA evtmnHourMinuteoutput = [FCmnTimeBetweenTimeSeconds]-[VA evtmnSecondsOutput]
VA evtmnMinuteOutput = mod(([VA evtmnHourMinuteoutput]/60),60)
VA evtmnHourOutput = (([FCmnTimeBetweenTimeSeconds]-([VA evtmnMinuteOutput]*60))-[VA evtmnSecondsOutput])/3600
FCmnTimeBetweenTimeHHMMSS = [VA evtmnHourOutput]10000+[VA evt_mnMinute_Output]100+[VA evtmnSecondsOutput]
Source: Oracle ID 662294.1