• 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/How To Calculate Age From Date Of Birth
Popular Search:Getting Started

How To Calculate Age From Date Of Birth

426 views 4 August 15, 2020 admin

As of now, Easy Forms has a special feature that would let you calculate the age using the date of birth quickly.

To get started, we are going to create a Form with a Date field (Label: Date of Birth), a Number field (Age), and a Submit button. Your form should look like this screenshot:

Calculate Age From Date Of Birth

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

1. Name: Calculate Age From Date Of Birth
2. Click “Add condition” > Date of Birth is present
3. Click “Add action” > Evaluate
5. Formula: differenceInYears(now(), {{date_1}})
6. Set Result to Field: Age.

Your Rule should look like this screenshot:

Conditional Rule To Calculate Age From Date Of Birth

Note: The differenceInYears() function calculates the number of years between two dates. Then we use the now() function to obtain the first date and the second date is obtained from the Date field.

That’s all!

Now your form should look like this:

Calculate Age From Date Of Birth

Was this helpful?

4 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
  • Calculate the Number of Days between Two Dates

Didn't find your answer? Contact Us

Leave A Comment Cancel reply

You must be logged in to post a comment.

Advanced Techniques
  • How To Calculate Age From Date Of Birth
  • 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

  How to Compare two email fields and Submit only if they are the same

Form Endpoints: Make fully customizable forms  

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