How can I subtract dates?

  • Profile Image
    kingfisherweddings
    Asked 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?

  • Profile Image
    Carina
    Answered 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
    kingfisherweddings
    Answered 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
    kingfisherweddings
    Answered 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
    Welvin
    Answered 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
    kingfisherweddings
    Answered 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
    victor
    Answered 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.