Time difference calculation

  • Lasaco
    Asked on June 25, 2022 at 1:22 PM

    Pls I want to build a report to show in a particular format. Also I have two fields that takes time in and time out and I want the report to show the time difference. For example If time in is 7.15am and Time out is 7.28 am, the difference is 13 minutes.

    Thank you

  • Ahrdhan_Y
    Replied on June 25, 2022 at 1:45 PM

    Hi Dimeji,

    Thanks for reaching out to Jotform Support, I see what you are trying to achieve here you may use the Form Calculation Widget to set this up.

    1. On the Form Builder, click the Add Form Element button.
    2. Go to the Widgets tab, then search for the widget Form Calculation.

    1656179070 62b7497eb2b84  Screenshot 10By adding the fields Time in and time out it will allow you to get the difference.

    This was the sample result:

    1656178767 62b7484fd236d  Screenshot 21

    Give it a try and let us know if you have more questions.

  • Lasaco
    Replied on June 25, 2022 at 2:59 PM

    I created a field called time spent in my table but discovered that the output is not correct.

    Kindly look at the form below to help me out.

    Thank you.

    https://form.jotform.com/221269363670054

  • Sigit JotForm Support
    Replied on June 25, 2022 at 5:22 PM

    Hello Dimeji,


    Thank you for getting back to us. I assume you're referring to this hidden form field.

    1656191550 62b77a3e7db84  Screenshot 10

    I cloned your form and tested it to see if I could replicate the issue, but the widget was working properly. Check out the screencast below to see my results:

    1656191898 62b77b9abb1e8  Screenshot 21

    And also correct on the form Table, as shown in the screenshot below:

    1656191965 62b77bdd20caa  Screenshot 32

    If that's not the case on your end, can you provide us more details and screenshot. This guide will help you do that. After we hear back from you, we’ll have a better idea of what’s going on and how to help.


  • Lasaco
    Replied on June 26, 2022 at 1:15 AM

    Thank you.

    The Hour part of the time is correct but the issue is with the minute part . For Instance I did Time in of 5.55am and Time out of 7.08am. I expect time spent to be 1.13 minutes but the answer the widget gave is 1.22.

    See the snapshot below

    1656220429 62b7eb0d2c4ec  Screenshot 10

    1656220478 62b7eb3eed6ad  Screenshot 21

    I await your feedback.

    Thank


  • Myla JotForm Support
    Replied on June 26, 2022 at 1:40 AM

    Hello Dimeji,

    Thank you for reaching back to us. I have cloned and checked the form to see the issue. Upon further checking, the form calculation is programmed to calculate based on percentage and not by minute. For the example given, Time in is 5:55 AM and Time out of 7:08 AM, that is a total of 1 hour 13 minutes in exact, and by percentage 13 minutes is 22% of 60.

    Let us know if you have any other questions.

  • Lasaco
    Replied on June 26, 2022 at 1:55 AM
    Thanks for your response.
    Kindly guide me on how to use the formula for conversion on the form
    calculation widget.
    Thank you for your support
    ...
  • Lasaco
    Replied on June 26, 2022 at 2:02 AM
    Thank you for the feedback.
    Kindly guide me on the conversion formula on the form calculation widget.
    Thank you
    ...
  • Herbert_Z
    Replied on June 26, 2022 at 3:15 AM

    Hello Dimeji,

    Thanks for getting back to us. We currently have no direct feature or calculation formula to convert the time percentage to hours and minutes. I've gone ahead and escalated your request to our Developer Team. When or if it's developed depends on their workload, how viable it is, and how many other users request it. If there are any updates, we’ll circle back to this thread and let you know.

  • Lasaco
    Replied on June 26, 2022 at 10:30 AM

    Ok. Thank you.

    Will await your feedback from the developers.

    Thank you