Date and Time
Parse, format, add, subtract, compare, round, and extract parts from dates with full timezone support.
The Date and Time node performs date and time operations within a workflow. It supports eight operations ranging from getting the current time to computing differences between two dates. All operations are timezone-aware when a timezone is specified.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
| Operation | Select | No | The date operation to perform. Defaults to Current Time. |
| Input Date | Text (variable) | No | The date value to operate on. Accepts ISO 8601 strings or template variables. Not shown for the Current Time operation. |
| Timezone | Timezone selector | No | Timezone for the operation. Uses the system default when left empty. Affects formatting, extraction, and display. |
Operations and Their Fields
Current Time -- Returns the current date and time. No additional fields.
Format Date -- Converts a date to a custom string format.
| Field | Type | Description |
|---|---|---|
| Format String | Text | Pattern using tokens like YYYY-MM-DD HH:mm:ss. Leave empty for ISO 8601 output. Supported tokens: YYYY, YY, MM, M, DD, D, HH, H, hh, mm, ss, SSS, A, a. |
Parse Date -- Parses a date string into a structured output. Takes only the Input Date field.
Add Duration / Subtract Duration -- Adds or subtracts a time duration from a date.
| Field | Type | Description |
|---|---|---|
| Amount | Number | The number of units to add or subtract. |
| Unit | Select | The time unit: Seconds, Minutes, Hours, Days, Weeks, Months, or Years. Months and years use calendar-aware arithmetic. |
Date Difference -- Computes the difference between two dates.
| Field | Type | Description |
|---|---|---|
| Start Date | Text (variable) | The first date (uses the Input Date field). |
| End Date | Text (variable) | The second date. |
The result is the difference in milliseconds. The output also includes an ISO 8601 duration string and a human-readable format.
Extract Part -- Extracts a specific component from a date. This operation is timezone-aware: when a timezone is set, parts are extracted in that timezone.
| Field | Type | Description |
|---|---|---|
| Part to Extract | Select | Year, Month, Day, Hour, Minute, Second, Weekday (0 is Sunday), Day of Year, or Week Number. |
Round Date -- Rounds a date to a boundary.
| Field | Type | Description |
|---|---|---|
| Round To | Select | Start of Day, End of Day, Start of Week, End of Week, Start of Month, End of Month, Start of Year, or End of Year. |
Output
| Field | Type | Description |
|---|---|---|
| result | string | The primary result, typically an ISO 8601 string or a formatted date. For Date Difference, this is the difference in milliseconds as a string. |
| iso | string | The date in ISO 8601 format. For Date Difference, this is an ISO 8601 duration (e.g., PT3600S). |
| unix | number | Unix timestamp in seconds. For Date Difference, this is the difference in seconds. |
| readable | string | A human-readable representation, localized to the selected timezone. |
| part | string | The name of the extracted part (Extract Part operation only). |
| value | number | The numeric value of the extracted part (Extract Part operation only). |
Example
A workflow that checks if a submitted date falls on a weekday:
- Form -- Collects a date field called
appointmentDate. - Date and Time -- Operation: Extract Part, Input:
appointmentDate, Part: Weekday, Timezone:America/New_York. - If/Else -- Condition:
dateTime_1.valueis greater than 0 ANDdateTime_1.valueis less than 6. - Send Email (true branch) -- Confirm the appointment.
- Send Email (false branch) -- Ask the user to pick a weekday.