Skip to main content
Shifts a date or datetime forward or backward by a duration assembled from the connected port inputs.

Duration units

The duration is built from the year, month, day, hour, and minute ports. Each unit may be positive or negative. Units that aren’t connected fall back to the value stored on the matching schema field, defaulting to zero.

Output type

The output type matches the input type. Date inputs are shifted with Date.shift/2 and ignore time-of-day units (hour, minute); NaiveDateTime and DateTime inputs are shifted with their respective shift/2 functions and honour every unit.

Ports