How Can I Have the Number of Hours between Two Date/Time Field Entries Calculated and Displayed?

  • excalibur101
    Asked on March 27, 2015 at 6:50 PM
  • excalibur101
    Replied on March 28, 2015 at 11:51 AM

    Thanks for your response. I didn't go any further than testing the link you supplied. When that calculation is done....it's wrong. For instance, if you input an eight hour period on a single date, the calculation says it's 7.92 hrs.  It's even off if you input a total of 30 minutes. 

    Any ideas?

  • AlanJordan
    Replied on March 28, 2015 at 12:13 PM

    I see the same issue.  The result for a 30-minute time difference is .48, not .50 hours.

  • abajan Jotform Support
    Replied on March 28, 2015 at 3:35 PM

    @excalibur101 and  AlanJordan

    Try this clone of my colleague's jotform. The expressions entered in its calculation fields are as follows:

    For the field labelled "Calculation" (hidden in my form) :

    How Can I Have the Number of Hours between Two Date/Time Field Entries Calculated and Displayed? Image 1 Screenshot 30


    For the "Hours" field:

    How Can I Have the Number of Hours between Two Date/Time Field Entries Calculated and Displayed? Image 2 Screenshot 41


    Of course, you're free to clone the form and examine it for yourselves.


    @AlanJordan

    Please open a separate thread if you need to discuss this further. (We've found it's better to deal with each user in their own thread.)

    Thanks

  • TycenDemolitions
    Replied on March 16, 2016 at 7:50 AM

    Excellent solution abajan ! works great for me! thanks.

     

  • mert JotForm UI Developer
    Replied on March 16, 2016 at 9:09 AM

    On behalf of my colleagues, you are most welcome. I hope everyone in this thread will be satisfied with the answer. Please, do let us know for further information.

     

    Best regards.