elapsed time

nkuebelbeck

nkuebelbeck

VIP Member
Is there a function that will take two time stamps and give me the time different in one number?
(HHMMSS)

EX (130000,131500) would return either

0.25 hours

15 minutes

900 seconds
 
I don't know of one off the top of my head. Have you searched? I imagine one probably exists.

It's a fairly simple exercise to write your own function. Remember, in JDE we have separate date and time fields... not a traditional datetime column.

I would account for the possibility of rolling over to the next date. IE: 23:58:00 to 00:05:00 of the next day.
 
Yeah, I search but closest thing I found was
NER: ConvertTimeHHMMSSToDecimal (N1700800)

I wrote this...It works but to your point doesn't account for elapsed time over days. In our specific case, date/time stamps that overlap a day are invalid and will not get into the database.

Data Structure: D550108D - Convert time from HHMMSS to decimal
BF mnTimeHHMMSS [UPMT]
BF mnTimeDecimal [CLAT]

----------------------------------------
Event Level Variables
----------------------------------------
evt_mnHours_MATH01 [MATH01]
evt_mnSeconds_MATH01 [MATH01]
evt_mnMinutes_MATH01 [MATH01]
evt_iMinutes_INT01 [INT01]
----------------------------------------
00001 VA evt_mnHours_MATH01 = [BF mnTimeHHMMSS]/10000-(mod([BF mnTimeHHMMSS],10000)/10000)
00002 VA evt_mnMinutes_MATH01 = mod([BF mnTimeHHMMSS],10000)/100
00003 VA evt_iMin_INT01 = [VA evt_mnMinutes_MATH01]
00004 VA evt_mnMinutes_MATH01 = [VA evt_iMinutes_INT01]/60
00005 VA evt_mnSeconds_MATH01 = mod([BF mnTimeHHMMSS],100)/3600
00006 BF mnTimeDecimal = [VA evt_mnHours_MATH01]+[VA evt_mnMinutes_MATH01]+[VA evt_mnSeconds_MATH01]
 
I beleive the following should do the trick. Pass in the date and time and it will return the duration with the bottem parameter being in seconds. Hope this helps.

Calculate the duration time
VA rpt_LRC_CRDJ_PreviousDate -> BF jdDateStart
VA rpt_LRC_TDAY_PreviousTimeOfDay -> BF mnBeginningTime
BC Date - Created (Julian) (F4111)(CRDJ) -> BF jdDateCompletion
BC Time of Day (F4111)(TDAY) -> BF mnEndingTime
RV Total Elapsed Minutes <- BF mnTimeConsumed
VA evt_LRC_ElapsedSeconds_CPUS <- BF mnTimeInSeconds
 
Can't find anything by that description. Got a function name or module?
 
Look on F9862.
I always use the 2 fields MD and FCTNM

B9500200 looks like a good candidate to me.
Returns the number in days hours minutes and seconds though
 
TIL: JDE UTIME

Time to rethink things.......My understanding was I had to store date/time seperately
 
[ QUOTE ]
Look on F9862.
I always use the 2 fields MD and FCTNM


[/ QUOTE ]

FYI, if you don't want to look directly in the tables, use P98652. I always use this to look for functions. It is the old Xe function selection dialog used in Xe ER code editors.
 
Or, if you use the JDE Object Browser, just select BSFN from the object type and you can search by function name. Screenshot attached.
grin.gif
 

Attachments

  • 186529-bsfnserach.jpg
    186529-bsfnserach.jpg
    70.7 KB · Views: 43
[ QUOTE ]
Or, if you use the JDE Object Browser, just select BSFN from the object type and you can search by function name. Screenshot attached.
grin.gif


[/ QUOTE ]

funny story, I use your object browser and love it! Didn't help me find it, of course I really didn't know exactly what to look for. *Time* yielded too many results.
 
Two bsfns that I've used - Calculate Eplapsed Time (B9000060) and Calculate Elapsed Case Time (N1700370).
 
[ QUOTE ]
Or, if you use the JDE Object Browser, just select BSFN from the object type and you can search by function name. Screenshot attached.
grin.gif


[/ QUOTE ]

LOL, yes even better.
 
Hello

You might want to look at B9000010 function (Calculate Workflow Duration). You just need to make very simple modifications to return the time in seconds.

It also takes care of the elapsed time over days.

I tested the function and it seems working for me.
 
Back
Top