problem with calculation between two date

  • Mustapha_cms
    Asked on July 19, 2021 at 5:06 AM

    hi there,

    i having a problem with calculation between two date

    my problem with these date.


    Date Start : 11/07/2021 at 1130hrs

    Date End : 16/7/2021 at 00:18hrs

    in jotform calculation the result is 4 days, 13 hours and 48 minutes

    But the actual result must be 4 days, 12hours and 48 minutes


    Please advise how to get the correct answer.. thanks




    Jotform Thread 3228017 Screenshot
  • Basil JotForm Support
    Replied on July 19, 2021 at 8:08 AM

    Hi,

    I have checked your form and you are using 0 decimal places for one field which rounds it, the hour's field value is being rounded to 13 hours.

    You should use the floor function in the field instead to prevent rounding.

    1626696465 60f56b118595f chrome uLMNtGTv Screenshot 10

    1626696500 60f56b35010ae chrome cbrgS9i3 Screenshot 21

    Please let us know if you require any further assistance.



  • Mustapha_cms
    Replied on July 20, 2021 at 11:39 PM

    hi,

    Thank you for your advise. finally get correct result.

  • Mustapha_cms
    Replied on July 20, 2021 at 11:41 PM

    a

    nother question can u advise how to calculate between two date in format no of year , month and days? any widget on this
    ?
  • Jovanne JotForm Support
    Replied on July 21, 2021 at 7:23 AM

    Hi,

    We will be responding to your other question on this separate thread https://www.jotform.com/answers/3233739 shortly.

    Thank you!