duration
FEEL built-in function · FEEL date and time functions
duration(from)
Creates a days-and-time or years-and-months duration from an ISO 8601 string.
FEEL has two duration types that do not mix. Days-and-time durations (P3D, PT2H) are exact amounts of time. Years-and-months durations (P1Y, P6M) are calendar amounts whose length depends on the month. Comparing one with the other gives null, because a month is not a fixed number of days.
Durations are normalized: PT90M becomes PT1H30M and P14M becomes P1Y2M. Weeks (P2W) are not part of the notation. The components are available as .days, .hours, .minutes, .seconds, .years and .months.
Parameters
| Parameter | Type | Description |
|---|---|---|
| from | string | ISO 8601 duration, e.g. P3D, PT2H30M or P1Y6M |
Examples
duration("P3DT4H")
duration("P1Y6M")
date("2026-07-01") + duration("P3D")
Edge cases and null handling
duration("P1D") = duration("PT24H")
duration("P1Y") = duration("P12M")
duration("PT2H") * 3
date("2026-07-24") + duration("P" + string(5) + "D")
Build a duration from a number by concatenating the ISO string.
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
years and months duration · date and time
Defined by the OMG DMN 1.6 specification, chapter 10.3.4 (built-in functions).