problem with calculation between two date

  • Profile Image
    Mustapha_cms
    Asked on July 19, 2021 at 05: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




    Screenshot
  • Profile Image
    Basil_A
    Answered on July 19, 2021 at 08: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

    1626696500_60f56b35010ae_chrome_cbrgS9i3

    Please let us know if you require any further assistance.



  • Profile Image
    Mustapha_cms
    Answered on July 20, 2021 at 11:39 PM

    hi,

    Thank you for your advise. finally get correct result.

  • Profile Image
    Mustapha_cms
    Answered 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
    ?
  • Profile Image
    Jovanne_A
    Answered on July 21, 2021 at 07:23 AM

    Hi,

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

    Thank you!