• Home
  • Blog
  • Documentation
  • FAQ
    • Pre-Sales Questions
  • Sign Up
  • Log Out
  • Get Easy Forms
  • Home
  • Blog
  • Documentation
  • FAQ
    • Pre-Sales Questions
  • Sign Up
  • Log Out
  • Get Easy Forms
home/Knowledge Base/Advanced Techniques/Calculate the Number of Days between Two Dates
Popular Search:Getting Started

Calculate the Number of Days between Two Dates

247 views 3 August 15, 2020 admin

Do you need to calculate the number of days between two dates? Now this is something that is very easy and pleasant to do.

To get started, we are going to create a Form with two date fields (Check In and Check Out), a number field (Number of days) and a submit button. Your form should looks like this screenshot:

Now go to the Rule Builder (Forms > Actions > Conditional rules) and click “Add rule”.

1. Name: Calculate days between dates
2. Click “Add condition” > Check In is present
3. Click “Add condition” > Check Out is present
4. Click “Add action” > Evaluate
5. Formula: differenceInDays({{date_2}}, {{date_1}})
6. Set Result to Field: Number of Days.

Your Rule should looks like this screenshot:

Note: To calculate the difference we set the Check Out field before the Check In field.

That’s all!

Now your form should look like this:

Was this helpful?

3 Yes  No
Related Articles
  • Dynamic Content: Conditional Logic with Dates
  • Date Based Conditional Logic
  • Calculate Difference of Time between Two Time fields
  • Date Formats with Dynamic Content
  • Create Users that Can Only Submit Forms
  • How To Calculate Age From Date Of Birth

Didn't find your answer? Contact Us

Leave A Comment Cancel reply

You must be logged in to post a comment.

Advanced Techniques
  • Calculate the Number of Days between Two Dates
  • Dynamic Content: Conditional Logic with Dates
  • Date Based Conditional Logic
  • Calculate Difference of Time between Two Time fields
  • Date Formats with Dynamic Content
  • Create Users that Can Only Submit Forms
View All 19  
Popular Articles
  • How to enable / disable DEBUG mode
  • How to update Form Stats from the command line
  • How to RTL (right-to-left) a Form?
  • How to Remove the Default Choice from a Select List Field
  • How to compare two fields to pass the validation (jQuery Validation)
KB Categories
  • Add-Ons
  • Advanced Techniques
  • Common Issues & Troubleshooting
  • Developers "How To's"
  • Getting Started
  • How To

  Create Users that Can Only Submit Forms

Calculate Difference of Time between Two Time fields  

About Easy Forms

With Easy Forms you can create unlimited web forms and most importantly the complete management of them without paying monthly fees

Resources
  • Knowledge Base
  • Documentation
  • Pre-sales Questions
  • Blog
Useful Help Links
  • Get Easy Forms
  • Live Demo
  • License Terms
  • Contact Us
Frequent Visit Links
  • Pre-Sales Questions
  • System Requirements
  • Installing Easy Forms
  • Upgrading Easy Forms
  • Privacy Policy
  • © 2015 - 2022 Baluart EIRL. All Rights Reserved.

Popular Search:Getting Started