Time between

Returns the time difference, as an integer, between two dates in a given time unit.

The time between function always subtracts the second date you provide from the first. For this reason, it is important to enter your dates in the correct order to ensure your resulting Eligibility Rule is correct. If you enter your dates in the wrong order, you may end up with a negative number instead of a positive number.

Example

time between [past date] and [now or future date] = Positive number
time between [now or future date] and {past date] = Negative number
Note: If you always want to return a positive number, consider combining the absolute of and time between functions.

Example Use Case

A company want to know a customers age, but only have access to their date of birth in the company CRM. Using the time between function they can return the customers age in a user-friendly format.

Example Eligibility Rule

time between now and dateOfBirth in years

Exp - time between

Notes

  • Time between can be returned in seconds, minutes, hours, days, weeks, months, or years.
  • To ensure that customer age is returned as a whole, positive, number you can combine this function with others. For more information, see Use case 1 - Calculating a customers age.