cancel
Showing results for 
Search instead for 
Did you mean: 
justmyway2
Nintex Newbie

Formula to calculate in HH:MM the time between to dates/times

Jump to solution

Hello.

I have a form with multiple sections that have separate Start and Stop times. I want to add a Calculated Value with a formula that displays HH:MM for the time between the Start and Stop dates/times. I can figure out HHs or MMs separate but not as HH:MM. 

Thanks, JB  

Labels: (1)
0 Kudos
Reply
4 Replies
Joel
Nintex Newbie

Re: Formula to calculate in HH:MM the time between to dates/times

Jump to solution

Hello JB,

 

I was able to create a formula to calculate the difference in time between to dates/times and display in the format HH:MM.

 

What I did is the following: 

  1. Create 2 date/time controls named "startdate" and "enddate"
  2. Create calculated value control named "hours" with the following formula:
    dateDiffHours(startdate,enddate)
  3. Create second calculated value control named "minutes" with the following formulate:
    dateDiffMinutes(startdate,enddate)-60*hours
  4. Create third calculated value control which would format it (HH:MM)
    hours + ":" + minutes

I've attached two screenshots showing the end result:test2.PNG

 

 

 

 

 

Test1.PNG

 

 

 

 

 

I hope this helps!

Thanks,

Joel W

Tags (1)
Reply
justmyway2
Nintex Newbie

Re: Formula to calculate in HH:MM the time between to dates/times

Jump to solution

Hey. Thanks for the help. I followed the steps identified and I am getting the following error.

Nintex HH.MM Error.jpg

Here is the setup of the following calculations.

Form1.jpgform2.jpgForm3.jpg

0 Kudos
Reply
justmyway2
Nintex Newbie

Re: Formula to calculate in HH:MM the time between to dates/times

Jump to solution
Thanks, Joel. Any insight into the errors that I am receiving following the directions provides?
JB
0 Kudos
Reply
justmyway2
Nintex Newbie

Re: Formula to calculate in HH:MM the time between to dates/times

Jump to solution

Hello.

I was actually able to figure it out in one calculated value without having to do three separate calculations.

 

 

0 Kudos
Reply