Add duration

Date and time Pure
Add duration
Value 1970-01-01T00:00:00Z
Result
Duration PT0S

Description

Pure function returning value + duration. Use a negative duration to subtract.

When to use

Use Add duration to compute a future or past datetime by adding a duration to a base datetime. Combine with Now to get a timestamp relative to the current moment, or with Parse date/time to shift a datetime from an external source. To subtract time, supply a negative amount to Duration of.

Pins

Input pins

Pin Type Default Notes
Value datetime 1970-01-01T00:00:00Z The base date/time to shift.
Duration duration PT0S The duration to add. Wire from `duration-of` or `duration-between`. A negative amount subtracts time.

Output pins

Pin Type Notes
Result datetime The shifted date/time.

Example

Compute an expiry time 24 hours from now. Wire the Result output of Now into the Value input of Add duration, and wire the Result output of Duration of (with Amount set to 24 and Unit set to Hours) into the Duration input. Feed the Result output of Add duration into Format date/time to produce a standard ISO timestamp for logging.

See also