How do I make my form do calculations on 2 fields (start time: hh:mm:ss) and end time (hh:mm:ss) and have the total displayed in seconds?

  • luaijaffal
    Asked on July 26, 2015 at 2:07 PM

    it is about a media monitoring project where we need to calculate the time dedicated to each candidate in seconds! 

  • David JotForm Support Manager
    Replied on July 26, 2015 at 2:23 PM

    1) Add the Date Time fields, enable the Time option.

    2) Add the Form Calculation widget(In this case I added two in order to show results in days and in seconds)

    How do I make my form do calculations on 2 fields (start time: hh:mm:ss) and end time (hh:mm:ss) and have the total displayed in seconds?  Image 1 Screenshot 40

    3) On the calculation widget, perform this calculation:

    How do I make my form do calculations on 2 fields (start time: hh:mm:ss) and end time (hh:mm:ss) and have the total displayed in seconds?  Image 2 Screenshot 51

    If you want it in days, simply remove the 86400.

    Please try my form here: http://form.jotform.co/form/52064996724869

    How do I make my form do calculations on 2 fields (start time: hh:mm:ss) and end time (hh:mm:ss) and have the total displayed in seconds?  Image 3 Screenshot 62

    You may clone my form to inspect further: http://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL

    Let us know if you need more help, we will be glad to assist you.

  • luaijaffal
    Replied on July 26, 2015 at 3:14 PM


    Thank you very much BDAVID! Very much appreciated your help! However my concern is about the date time field i would need to show the seconds field....for example start time: 14:22:32  end time:14:24:45 so the total time shoul show 133 seconds.
    As said befor it is about media monitoring project during election campaigne! So seconds is very important to do a proper and fair calculatin.
    Thank you again and hope there is away to do that!
    Luai
    Sent from my Samsung device
    ...
  • jonathan
    Replied on July 26, 2015 at 4:36 PM

    Unfortunately, DateTime field and other Time fields doesn't have Seconds property on them. So, there is no means to show the seconds time on the DateTime field itself.

    The solution provided by our colleague BDavid does show time calculations in seconds between 2 time.

    But perhaps an additional display of time up to seconds is all you need to add on your form so that the end user will be aware of the ticking time in seconds as well.

    How about adding the Countdown widget into the form also. It will allow the end user have a visual cue as to how many seconds had already tick on.

    link: http://widgets.jotform.com/widget/countdown

    It can complement the solution by BDavid that shows the calculated total time in seconds.

    Here is the demo form that have a Countdown widget on it http://form.jotformpro.com/form/43440585745965

    Hope this help. Let us know how we can be of further assistance.

    Thanks.