How to store difference between start time and end time in HH:MM:SS format.

1
I am trying to store difference between startTime & endTime  attribute in diffBetTime attribute (HH:MM:SS). what should be the data type of diffbetTime and how to calculate expected result in appropriate format? check below image for reference..  as i have done it In microflow using minutesBetween but i want eaxact HH:MM:SS format  
asked
3 answers
1

It should be a decimal indeed.
In a MF you can use the function minutesBetween

More info on this is in the documentation:
https://docs.mendix.com/refguide/between-date-function-calls

answered
1

Hi Darshana,

you can create a microflow that recieves a customer. And the you can create a variable with this value:

This gives you the total of seconds between those dates. The you can transform it into (HH:MM:SS). I saw this idea in https://docs.mendix.com/refguide/between-date-function-calls

Even this link can help you in the next steps:  https://docs.mendix.com/refguide/parse-and-format-date-function-calls

I hope this can help you.

Best regards!

answered
0

There is no straight forward way to transform the difference into (HH:MM:SS). You will need to follow these steps in a microflow:

  1. S1=secondsBetween(Date1, Date2)
  2.  H1= S1/3600 
  3. HH= round(H1,0)
  4. M1=  (H1-HH)*60
  5. MM= round(M1,0)
  6. SS=round((M1-MM)*60,0)
  7.  Date Difference = toString(HH)+’:’+toString(MM)+’:’toString(SS)
answered