Get time difference between start and end date

0
Hi Team, I would like to know how to convert time difference between start date and end date it should look like this
asked
3 answers
1

Hi Akash,

 

You can use the hoursBetween function to calculate the hours between two datetimes, see https://docs.mendix.com/refguide/between-date-function-calls/#5-hoursbetween

 

I hope this helps.

Michiel

 

answered
1

Hi Akash Gunupudi,

Certainly! Let’s format this professionally:

  1. Create the Duration Variable:

    • In your Mendix app, create a variable named “Duration” with the data type Integer or Long.
    • Use the function floor(minutesBetween($Schedule/From, $Schedule/To)) to calculate the duration between the “From” and “To” times in minutes.
  2. Display the Duration:

    • Create a string variable to display the calculated duration.
    • Use the following expression:
      formatDecimal(floor($Duration / 60), '00') + ':' + formatDecimal(floor($Duration mod 60), '00')
      
    • Store this value in your string attribute and display it wherever needed.

Remember to adjust the variable names and attributes according to your specific use case. Happy Mendix development! 😊


Microflow.PNGVariable1.PNGVariable2.PNG

answered
0

in a microflow u can do this 

 

hoursBetween($startTime,$endTime) + ' Hours'

Between Date Function Calls | Mendix Documentation

Hope it heps

answered