Need to calculate the days between dates but don't want to have to bust out a calendar? This datepicker plugin lets you create custom date calculators without code!

Approximate read time: 7 minutes
Whether you want to create a cost estimator for a vacation property or help expectant parents count down to their baby's due date, finding the number of days between two dates can really come in handy.
Here are just a few examples of how an online date calculator can add value to your website:
- โณ Deadline calculator
- ๐ซ Event countdown
- ๐ถ Pregnancy calculator
- ๐ฆ Shipping date calculator
- ๐งณ Travel, booking, or rental price calculator
- ๐ชช Visa calculator
But if you landed on this article, you probably already have an idea of why you want to count the number of days between dates. So, we'll get right down to business.
We definitely want to hear how you plan to use this tool, though โ reply to this post below to let us know! ๐ฌ
How to calculate the number of days between dates
In today's tutorial, we will make a simple calculator to estimate the cost of renting a bike for a certain duration. Ready to get rolling? Let's go! ๐ด
Step 1: Install and activate Formidable Forms Pro
To make a custom date calculator for your website, you first need Formidable Forms Pro on your WordPress site. If you don't have the plugin yet, click the button below to grab your license.๐
The date calculation feature is included in the Business plan and above.
Once you've installed and activated the plugin, go to Formidable โ Add-Ons. Then click to install and activate the Datepicker Options add-on.

All set? Super! ๐ Let's start creating our calculator!
Step 2: Create your date calculator form
From the WordPress dashboard, head on over to Formidable โ Forms. Next, click the blue + Add New button to create a new form.

And voilร ! ๐ช You should now see several different options for building your calculator.
Choose our pregnancy due date calculator template, age calculator template, or deadline calculator form if you'd like to hit the ground running with a premade calculator. ๐๐ผ
For today's tutorial, we're going to make a basic calculator form from scratch instead by selecting Blank Form.

We'll name our calculator form and click Create to open up the drag-and-drop form builder.
Now, let's drag two ๐๏ธ Date fields into our form along with a # Number field. We'll click on each field in the form to edit the field name, description, and layout.
For this example, why don't we make the first date field the bike pickup date and the second the date when the customer will return the bike? That'll make it easy to calculate how many days are between the two dates.
Then, we can multiply by the daily rental rate. ๐ค

Still with us? Awesome. Only a little further to go!
Next, it's time to make our form do some math. ๐งฎ
Click on the number field to pull up its field settings โ in the example below, our number field is called "Duration of rental." Under the Advanced section of the Field Options tab, insert the formula for your date calculation.
Here, as we only want to find the total number of days between two dates, we simply subtract the Pickup date field (or start date) from the Drop off date field (aka end date).

Since we want to give visitors a price estimate for their bike rental, we'll add a few other form fields so they can pick the type of bike they want and then calculate the rental cost. ๐ฒ
When you're happy with your form, click Update and then Preview to test your cool custom date calculator!
Step 3: Publish your calculator
It's all downhill from here! ๐ต
To publish your date calculator, open up the WordPress post or page where you want to display your calculator. Then, just add the Formidable Forms block in the editor and select your calculator form from the dropdown menu that appears.
Way to go! ๐ You now have a way to calculate the difference between two dates on your site!
In case you're curious, here's how our bike rental calculator ended up:

Go beyond just counting the days between two dates
Formidable's datepicker calculations can do a lot more than tell you how many days are between two dates.
You can also find the date a specific number of days since or following a given date, exclude weekends from day counts, or automatically determine the day of the week for any date on the Julian calendar. ๐ฒ
More how-tos are on the way, but here are some highlights to hold you over for now:
Want to use the current date in your calculator?
Nothing could be easier! Just click the date field in your form, then set the default value for that field to be the current date in the settings on the left side of the screen.

You could also set the field to "Read only" so that it can't be modified or even hide the field so visitors won't see it.
It may not make much sense for our bike rental form, but it's ideal for countdowns. โฒ๏ธ
For example, here's a wedding countdown calculator we made to instantly calculate the number of days between the current date and a future date.

Add or subtract days from a specific date
With Formidable Forms, you can quickly make a calculator to find the date a certain number of years, months, weeks, or days from a specific date.
Check out our tutorial on how to calculate the day from a date to instantly find a past or future date!

Only count business days / exclude weekends
Are you using your date calculator for business? Whether for delivery dates or payment periods, the odds are good you'll only want to count working days in your calculations.
In three quick clicks, you can exclude weekends when counting the number of days in a certain period.
1. In the field settings for your date field, click to uncheck the All Days box for Days of the week.

2. Uncheck the boxes for any days of the week you'd like to exclude.

And you're done! Now your datepicker popup calendar won't let users select days you've excluded.

You can also choose to limit the time span before or after a specific date to 28 days rather than 30 or 31 days, this way, you're sure it will fall on the same day of the week as the initial date selected.
Include the last day in your calculations
Sometimes, when counting the number of days between two dates, you may want to include the first or last day in your calculations. This is especially important if you're creating a visa calculator or a similar time calculator tool.
Luckily, it's really easy to do with Formidable. Simply add a "+1" to your date calculation formula.

And then, ta-da! Your calculator now includes the dates entered when counting the number of days between two dates.

Ready to quickly calculate the number of days between dates?
Whether you're looking to streamline your event planning, simplify travel arrangements, or conquer complex time-based challenges, Formidable Forms can help you create a custom online date calculator for your WordPress website.
Forget fighting with formulas in Excel or Google Sheets. And you don't need to know anything about HTML or JavaScript either.
All you have to know is how to click a couple of buttons to install our all-in-one plugin! Easy peasy!
So what are you waiting for? Add value to your site and multiply your traffic by adding a date calculator now.
Try out our calculator and form maker plugin for yourself to see how simple it is to supercharge your website. And if for some reason, you don't fall head over heels, we offer a 14-day money-back guarantee!
And be sure to follow our Facebook, Twitter, and YouTube for more date calculation tips!
Leave a Reply