years and months duration
FEEL built-in function · FEEL date and time functions
years and months duration(from, to)
Returns the duration between two dates as whole years and months, dropping smaller units.
Parameters
| Parameter | Type | Description |
|---|---|---|
| from | date | start date |
| to | date | end date |
Examples
years and months duration(date("2024-01-10"), date("2026-07-24"))
P2Y6M
Try it ↑
Edge cases and null handling
years and months duration(date("2000-03-15"), date("2026-07-24")).years
26
Try it ↑
A common way to compute an age in whole years.
Part of FEEL date and time functions: date arithmetic, the two kinds of duration, time zones, and every temporal function side by side.
Related functions
Defined by the OMG DMN 1.6 specification, chapter 10.3.4 (built-in functions).