How can I calculate difference between two dates in Days, months, and years?

  • Profile Image
    smai
    Asked on October 24, 2016 at 09:33 PM

    Is there a magic formula to make this happen?

    I am trying to create a Warranty Claim form, where the customer inputs the date purchased.

    This will then (hopefully) auto-calculate the period lapsed since purchase in another text box field.

     

    I.e.

    Time lapsed = 3 years, 2 months, 1 day

    = 2 months, 5 days

    = 29 days etc. etc.

     

    The magic calculator doesn't do 'IF' formulas does it?

  • Profile Image
    Chriistian
    Answered on October 25, 2016 at 12:32 AM

    You can use the Form Calculation widget to calculate the difference between two dates. 

    1. First, add the form calculation widget.

    2. Then input the formula seen below. Here's a guide that can help: How to Perform Calculation in the Form?

    The result should be the number of days since the purchased date.

    For months, simply add another Form Calculation widget and add the formula below:

    Here's the result:

    You can also clone my demo form to test it and see it in action here: https://form.jotform.com/62980617429970.

    If you need further assistance, please let us know.
    Regards.