Forum Discussion
DeepaPrashant1
Qrew Cadet
Thank you Mark. I was looking for this as well. However, I need to add seconds as well and so have also created a pure StartDate and End Date and Start Time and End Time fields in Date only and Time only formats as the Date-time format does not support seconds.
It appears the rounding in minutes is throwing my duration off. So if my Start Date and Time is 07-03-2020 23:02:30 and End Date and Time is 07-04-2020 06:03:05, i got my hours to calculate as 7 hours, but minutes should be 0 and seconds 35. Not getting that!
Can you help?
------------------------------
Deepa Deepa
------------------------------
It appears the rounding in minutes is throwing my duration off. So if my Start Date and Time is 07-03-2020 23:02:30 and End Date and Time is 07-04-2020 06:03:05, i got my hours to calculate as 7 hours, but minutes should be 0 and seconds 35. Not getting that!
Can you help?
------------------------------
Deepa Deepa
------------------------------
DeepaPrashant1
4 years agoQrew Cadet
Oh! I figured it out. Just needed to clear my head :-)
Duration (hrs) - ToNumber(Left(ToText(ToDays([10. Duration (Date/Time)])*24),"."))
Duration (mins) - If (Minute([10. End Time])<Minute([10. Start Time]) ,Minute([10. End Time])+60-Minute([10. Start Time]),Second([10. End Time])<Second([10. Start Time]),Minute([10. End Time])-Minute([10. Start Time])-1)
Duration (secs) - If (Second([10. End Time])<Second([10. Start Time]),(Second([10. End Time])+60)-Second([10. Start Time]),Second([10. End Time])-Second([10. Start Time]))
------------------------------
Deepa Deepa
------------------------------
Duration (hrs) - ToNumber(Left(ToText(ToDays([10. Duration (Date/Time)])*24),"."))
Duration (mins) - If (Minute([10. End Time])<Minute([10. Start Time]) ,Minute([10. End Time])+60-Minute([10. Start Time]),Second([10. End Time])<Second([10. Start Time]),Minute([10. End Time])-Minute([10. Start Time])-1)
Duration (secs) - If (Second([10. End Time])<Second([10. Start Time]),(Second([10. End Time])+60)-Second([10. Start Time]),Second([10. End Time])-Second([10. Start Time]))
------------------------------
Deepa Deepa
------------------------------