SLA Time in (a Years, b Months, c Days, d Hours, e Minutes, f Seconds) format

0
Hi, I’m New to Mendix please guide How to calculate SLA Time Taken for finding the difference between Received Date and Processed Date  in this format “a years, b months, c days, d hours, e minutes, f seconds” in a column, where a,b,c,d,e,f are numbers . Is this possible in mendix microflow or should i prefer java action ?? if it’s possible in mendix can anyone give me a hint to achieve it.     SLA Time Taken = Received Date – Processed Date  (a Years, b Months, c Days, d Hours, e Minutes, f Seconds)
asked
1 answers
0

You will need to follow these steps in a microflow: (Assuming Date1 is the earlier date and Date2 is the latter date)

YY= YearsBetween(Date1, Date2)
Date1A=addYears(Date1,YY)
MM=MonthsBetween(Date1A, Date2)
Date1C=addMonths(Date1A,MM)
DD= daysBetween(Date1C, Date2)
Date1D=addDays(Date1C,DD)
S1=secondsBetween(Date1D, Date2)
 H1= S1/3600 
HH= round(H1,0)
M1=  (H1-HH)*60
MM= round(M1,0)
SS=round((M1-MM)*60,0)
 Date Difference = toString(YY)+':'+toString(MM)+':'+toString(DD)+':'+toString(HH)+’:’+toString(MM)+’:’toString(SS)

answered