Date & Time Operators
Date operators let you compare dates, check if something is recent, and validate ages.
Later Than
Section titled “Later Than”Check if a date is after another date:
__expiry__ of **License** is later than date(2024-01-01)Interactive Example
Earlier Than
Section titled “Earlier Than”Check if a date is before another date:
__created__ of **Account** is earlier than date(2020-01-01)Interactive Example
Within (Recency)
Section titled “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 yearsSupported time units: seconds, minutes, hours, days, weeks, months, years, decades, centuries.
Interactive Example
Older Than
Section titled “Older Than”Check if a date-based age exceeds a duration. Useful for age verification:
__date_of_birth__ of **Person** is older than 18 yearsInteractive Example
Younger Than
Section titled “Younger Than”The inverse of older than:
__date_of_birth__ of **Person** is younger than 65 yearsInteractive Example
Comparing Against Another Property
Section titled “Comparing Against Another Property”All duration operators (within, older than, younger than) can compare against another date property instead of the current date by adding of followed by a property access:
<property> is <operator> <duration> of [the] <property>Within … of
Section titled “Within … of”Check if two dates fall within a duration of each other:
the __date__ of the **theory** in the **testDates** in the **drivingTest** is within 2 years of the __date__ of the **practical** in the **testDates** in the **drivingTest**Interactive Example
When the dates are too far apart, the condition fails:
Interactive Example
Older Than … of
Section titled “Older Than … of”Check if one date is older than a duration relative to another date:
__start_date__ of **Contract** is older than 1 year of __end_date__ of **Contract**Younger Than … of
Section titled “Younger Than … of”Check if one date is younger than a duration relative to another date:
__renewal__ of **Policy** is younger than 6 months of __expiry__ of **Policy**Duration Units
Section titled “Duration Units”All supported time units:
| Unit | Singular | Plural |
|---|---|---|
| Second | second | seconds |
| Minute | minute | minutes |
| Hour | hour | hours |
| Day | day | days |
| Week | week | weeks |
| Month | month | months |
| Year | year | years |
| Decade | decade | decades |
| Century | century | centuries |