• 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 Difference of Time between Two Time fields
Popular Search:Getting Started

Calculate Difference of Time between Two Time fields

199 views 0 September 15, 2021 admin

Calculate Difference of Time

To calculate the difference between two time fields in hours, minutes, or seconds, use the following formula:

getTimeDiff({{date_2}}, {{date_1}}, 's')

Where date_2 is the first time point (2nd time field) and date_1 is the second time point. Replace these with your own variables.

You can also change the units of time:

For hours: use ‘h’ instead of ‘s’
For minutes: use ‘m’ instead of ‘s’
For miliseconds: use ‘ms’ instead of ‘s’

Since time fields capture only hours and minutes, this difference is only less than 24 hs.

Note: This formula is valid only for two time fields or time values (same date).

Form Builder

In the Form Builder, we added two time fields, three text fields and a button.

Rule Builder

In the Rule Builder we added the following rule:

– Condition: When both time fields are present
– Actions: Evaluate our formula and display the result in the respective field

That’s it!

Was this helpful?

Yes  No
Related Articles
  • Dynamic Content: Conditional Logic with Dates
  • Date Based Conditional Logic
  • Date Formats with Dynamic Content
  • Create Users that Can Only Submit Forms
  • How To Calculate Age From Date Of Birth
  • 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
  • Calculate Difference of Time between Two Time fields
  • Dynamic Content: Conditional Logic with Dates
  • Date Based Conditional Logic
  • Date Formats with Dynamic Content
  • Create Users that Can Only Submit Forms
  • How To Calculate Age From Date Of Birth
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

  Calculate the Number of Days between Two Dates

Auto-Fill a Form Using the Form Widget  

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