How can I subtract dates?

  • kingfisherweddings
    Asked on January 6, 2016 at 8: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?

  • Carina
    Replied on January 6, 2016 at 10:01 AM

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

    How can I subtract dates? Image 1 Screenshot 20

     

    You can test and clone the demo form:  

    https://form.jotform.com/60054538443958 

     

    Let us know if we can assist you further.   

  • kingfisherweddings
    Replied on January 6, 2016 at 10:46 AM
    nope, this doesn't work I have already tried this method :(
    06.01.2016, 15:01, "JotForm" :
    ...
  • kingfisherweddings
    Replied on January 6, 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 :(
    ...

  • Welvin Support Team Lead
    Replied on January 6, 2016 at 1: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:

    How can I subtract dates? Image 1 Screenshot 20

    Would you like us to do it for you? 

  • kingfisherweddings
    Replied on January 6, 2016 at 1: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
    ...
  • victor
    Replied on January 6, 2016 at 5: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.