How to calculate difference between start date and end date

  • Akif Altundal
    Asked on November 1, 2024 at 5:57 AM

    How can I calculate the duration using start datetime and end datetime?

    In the form I am collecting start datetime and end datetime.

    I need duration in the google calendar integration.

  • Haseeb_N
    Replied on November 1, 2024 at 6:08 AM

    Hi Akif,

    Thanks for reaching out to Jotform Support. I’ll need a bit of time to look into this. I’ll get back to you as soon as I can.

    Thanks for your patience, we appreciate it.

  • Haseeb_N
    Replied on November 3, 2024 at 10:19 AM

    Hi Akif,

    You can add two Date Picker widgets to your form and can add a Form Calculation widget to calculate the difference between two dates. ​​Let me help you do it:

    1. In the Form Builder, click on Add Elements and add two Date Picker Fields.
    2. Now, add a Form Calculation widget.
    3. Set a calculation like this to calculate the difference. How to calculate difference between start date and end date Image 1 Screenshot 40 How to calculate difference between start date and end date Image 2 Screenshot 51

    Now you need to integrate your form with Google Calendar and set the end date as Duration, and it will mark those days as selected as shown in screenshot below.

    How to calculate difference between start date and end date Image 3 Screenshot 62

    You can also check our guide: How to Integrate Jotform with Google Calendar.

    If that’s not exactly what you’re looking for, can you explain a bit more so I can help you better?