What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    How can I subtract dates?

    Asked by kingfisherweddings on January 06, 2016 at 08:22 AM

    Is there a way I can calculate the difference between two dates.

    I have a date field which I have created for the date of the form submission (auto filled with today's date & hidden) then further on I have a date field for an event (user to input).

    I would like to work out the difference in days between when the form is submitted (today) and the time of the event.

    Any ideas guys?

    Page URL:
    https://form.jotformeu.com/kingfisherweddings/-making-an-enquiry-appli<br/>cation

    date field today's date subtract dates
  • Profile Image

    Answered by Carina on January 06, 2016 at 10:01 AM

    You can add the 2 DateTime fields, add a form calculation widget and subtract both the fields:

     

    You can test and clone the demo form:  

    https://form.jotform.com/60054538443958 

     

    Let us know if we can assist you further.   

  • Profile Image

    Answered by kingfisherweddings on January 06, 2016 at 10:46 AM
    nope, this doesn't work I have already tried this method :(
    06.01.2016, 15:01, "JotForm" :
    ...
  • Profile Image

    Answered by kingfisherweddings on January 06, 2016 at 10:46 AM

    It just shows a string of date numbers like 20160816 (16th august 2016) - another string of date numbers. It doesn't actually show the difference :(
    ...

  • Profile Image
    JotForm Support

    Answered by Welvin on January 06, 2016 at 01:08 PM

    You should do the same method used by my colleague. Simply subtract the date fields and that's it, you should get the number of days. Here's an exact calculation:

    Would you like us to do it for you? 

  • Profile Image

    Answered by kingfisherweddings on January 06, 2016 at 01:46 PM
    I think it hAs done it guys cheers xKind regards,David Gray07881293648www.kingfisherweddings.co.uk06.01.2016, 18:08, "JotForm" <noreply@jotform.com>:A new response has been received:Answered by WelvinYou should do the same method used by my colleague. Simply subtract the date fields and that's it, you should get the number of days. Here's an exact calculation:Would you like us to do it for you? View this thread on browser » Unsubscribe Thread1452103703
    ...
  • Profile Image

    Answered by victor on January 06, 2016 at 05:14 PM

    On behalf of Carina and Welvin, you are welcome. If you have any other question or issue, please do not hesitate contacting us. We will be glad to help.