Skip to main content

Date Time

The Date Time node provides comprehensive date and time operations: arithmetic (add, subtract), comparison, extraction of date parts, rounding, formatting, parsing, and timestamp conversion. All operations support time zones and standard date format patterns.

Actions

ActionDescription
dateTime:addAdd a duration to a date/time
dateTime:subtractSubtract a duration from a date/time
dateTime:compareTwoDateTimesCompare two date/time values
dateTime:extractExtract a part (year, month, day, etc.) from a date/time
dateTime:roundRound a date/time to the nearest unit
dateTime:formatFormat a date/time into a string
dateTime:nowGet the current date/time
dateTime:parseParse a string into a date/time
dateTime:diffCalculate the difference between two date/times
dateTime:toTimestampConvert a date/time to a Unix timestamp
dateTime:fromTimestampConvert a Unix timestamp to a date/time

dateTime:add

Adds a specified duration to a date/time value.

Parameters

ParameterTypeRequiredDescription
dateTimestringYesInput date/time (ISO 8601 or parseable string)
amountintegerYesNumber of units to add
unitstringYesTime unit: years, months, weeks, days, hours, minutes, seconds, milliseconds
timezonestringNoTime zone (e.g., America/New_York). Defaults to UTC

dateTime:subtract

Subtracts a specified duration from a date/time value.

Parameters

Same as add.

dateTime:compareTwoDateTimes

Compares two date/time values and returns the relationship (before, after, or equal).

Parameters

ParameterTypeRequiredDescription
dateTime1stringYesFirst date/time
dateTime2stringYesSecond date/time
operatorstringNoComparison: before, after, equals, beforeOrEquals, afterOrEquals. Defaults to returning the relationship

dateTime:extract

Extracts a specific component from a date/time value.

Parameters

ParameterTypeRequiredDescription
dateTimestringYesInput date/time
partstringYesPart to extract: year, month, day, hour, minute, second, dayOfWeek, dayOfYear, weekOfYear, quarter
timezonestringNoTime zone for extraction

dateTime:round

Rounds a date/time to the nearest specified unit.

Parameters

ParameterTypeRequiredDescription
dateTimestringYesInput date/time
unitstringYesUnit to round to: day, hour, minute, month
modestringNoRounding mode: floor, ceil, round. Defaults to round

Result: 2025-06-15T14:00:00Z

dateTime:format

Formats a date/time into a string using a specified pattern.

Parameters

ParameterTypeRequiredDescription
dateTimestringYesInput date/time
formatstringYesOutput format pattern (e.g., yyyy-MM-dd, MM/dd/yyyy HH:mm:ss, EEE, MMM d yyyy)
timezonestringNoTarget time zone
localestringNoLocale for formatting (e.g., en-US, de-DE)

Result: June 15, 2025 at 10:30 AM

dateTime:now

Returns the current date and time.

Parameters

ParameterTypeRequiredDescription
timezonestringNoTime zone. Defaults to UTC
formatstringNoOutput format pattern. Defaults to ISO 8601

dateTime:parse

Parses a date/time string using a specified input format.

Parameters

ParameterTypeRequiredDescription
inputstringYesThe date string to parse
formatstringYesExpected input format pattern
timezonestringNoTime zone to assume if not present in the input

dateTime:diff

Calculates the difference between two date/time values in the specified unit.

Parameters

ParameterTypeRequiredDescription
dateTime1stringYesStart date/time
dateTime2stringYesEnd date/time
unitstringYesUnit for the result: years, months, days, hours, minutes, seconds

dateTime:toTimestamp

Converts a date/time string to a Unix timestamp (milliseconds since epoch).

Parameters

ParameterTypeRequiredDescription
dateTimestringYesInput date/time

dateTime:fromTimestamp

Converts a Unix timestamp to a date/time string.

Parameters

ParameterTypeRequiredDescription
timestampnumberYesUnix timestamp in milliseconds
timezonestringNoOutput time zone. Defaults to UTC
formatstringNoOutput format. Defaults to ISO 8601

Connection

No connection required. This is a utility node that operates on in-memory values.

Output

All date/time actions return a result in this format:

For diff, the result is a number. For extract, the result is the extracted part (integer or string). For compareTwoDateTimes with an operator, the result is a boolean.