How do i find out the lapsed time between two date time?
Created date time: 00:40:30
Response time: 00:00:01:36 ==> How can i get this value?
Job started: 00:42:06
Hi Drexxor,
Check this forge components
https://www.outsystems.com/forge/component-overview/11986/elapsed-time
https://www.outsystems.com/forge/component-overview/11318/reactive-elapsed-timer
Hope that it helps you
You can use functions like DiffHours/DiffMinutes/DiffSeconds to get time difference between dates.
Attention that each one will return the total, so in this scenario
DiffMinutes=1 and DiffSeconds=96 (60+36)
But you can add the seconds to a NullDate to get the time since Start and then cast DateTime to Time to have only the hh:mm:ss bit.
DateTimeToTime(AddSeconds(NullDate(),DiffSeconds(StartDateTime,EndDateTime)))
If your difference is over 24h, you can use DiffDays to get the days portion.
I think the exact solution for your problem is this:
DiffDays(DateTime1,DateTime2) + ":" +
Mod((DiffHours(DateTime1,DateTime2)),24) + ":" +
Mod((DiffMinutes(DateTime1,DateTime2)),60) + ":" +
Mod((DiffSeconds(DateTime1,DateTime2)),60)
As Nuno Reis mentioned, you can use DiffDays/DiffHours/DiffMinutes/DiffSeconds to calculate the difference between dates.
With the assist of Mod function, you can build your expression as described above.
Hope it solves your problem.
This worked. Thanks.
It is possible, but maybe ":" is not the best separator between days and hours. That's why I left on the side.
This seemed a "how long my timer took?" question.