This article requires the GP Date Time Calculator perk. Buy Gravity Perks today to get this perk plus 33 other premium Gravity Forms plugins!
There’s plenty of scenarios where counting the number of days between two given date fields is useful in your forms. For example, you might have a form that’s used to register users for a multi-day event or you want to build a form for tracking the number of days an employee has been with your company. Whatever your use case, this tutorial will help you calculate the number of days between two dates with ease.
Gravity Forms Date Time Calculator adds support for date and time calculations in any Gravity Forms field that supports calculations. We can use it to accurately calculate the number of days between two date fields in our form.
Steps
Step 1 – Add Start and End Dates
Add two Date fields to your form, name them “Start Date” and “End Date”, and set your desired date format.

Step 2 – Calculate the Number of Days
Add a Number field to your form and name it “Number of Days”. In the Formula box, subtract Start Date’s merge tag from End Date’s merge tag.

That’s all there is to it! You now have a Number field that dynamically displays the number of days based on user input in the Date fields.
Taking This Further
You can do a number of interesting things now that you have this count. For example, you can show another field in the form using conditional logic based on the number of days counted. This has a variety of uses, like offering different pricing structures or a discount once the customer has selected a minimum number of days.

You can use a similar technique to set up age-based pricing with GF Date Time Calculator. Check out the following tutorial on how to set that up:
How to Set Up Age Based Pricing
Questions? Comments?
Do you have any questions on setting this up? Do you have an interesting use case you’d like to tell us about? We’d love to hear them. Leave us a comment below.
Did this resource help you do something awesome with Gravity Forms? Then you'll absolutely love Gravity Perks; a suite of 32+ essential add-ons for Gravity Forms with support you can count on.
Hi David, I wonder if this addon works with the feature of calculating the target date with source date and user-specified date count?