Skip to content

Date & Time Operators

Date operators let you compare dates, check if something is recent, and validate ages.

Later Than

Check if a date is after another date:

__expiry__ of **License** is later than date(2024-01-01)

Interactive Example

Policy Rule
Test Data (JSON)

Earlier Than

Check if a date is before another date:

__created__ of **Account** is earlier than date(2020-01-01)

Interactive Example

Policy Rule
Test Data (JSON)

Within (Recency)

Check if a date is within a duration from now:

__last_login__ of **User** is within 30 days
__test_date__ of **Driver** is within 2 years

Supported time units: seconds, minutes, hours, days, weeks, months, years, decades, centuries.

Interactive Example

Policy Rule
Test Data (JSON)

Older Than

Check if a date-based age exceeds a duration. Useful for age verification:

__date_of_birth__ of **Person** is older than 18 years

Interactive Example

Policy Rule
Test Data (JSON)

Younger Than

The inverse of older than:

__date_of_birth__ of **Person** is younger than 65 years

Interactive Example

Policy Rule
Test Data (JSON)

Duration Units

All supported time units:

UnitSingularPlural
Secondsecondseconds
Minuteminuteminutes
Hourhourhours
Daydaydays
Weekweekweeks
Monthmonthmonths
Yearyearyears
Decadedecadedecades
Centurycenturycenturies