Adjust Wall Clock Date
Uncontrolled node
Overview
The Adjust Wall Clock Date node performs timezone-agnostic arithmetic on datetime strings. It takes a date string and adjusts it by adding or subtracting specified amounts of years, months, days, hours, minutes, and seconds. The node handles calendar logic such as leap years and month-end clamping (e.g., January 31 + 1 month = February 28/29).
This node is useful for scheduling tasks, calculating deadlines, or manipulating dates without worrying about timezone conversions or daylight saving time transitions.
Supported Formats
The node supports strict parsing and formatting of the following wall-clock formats:
| Format | Example |
|---|---|
| YYYY-MM-DD | 2023-12-25 |
| YYYY-MM-DD HH:mm:ss | 2023-12-25 14:30:00 |
| YYYY-MM-DDTHH:mm:ss | 2023-12-25T14:30:00 |
| YYYYMMDD | 20231225 |
| YYYYMMDDHHmmss | 20231225143000 |
| MM/DD/YYYY | 12/25/2023 |
| DD/MM/YYYY | 25/12/2023 |
| ISO | 2023-12-25T14:30:00 |
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Input | Text | The datetime string to adjust. Must match the specified input format. | - |
| Input Format | Enum | The format of the input datetime string. | YYYY-MM-DD HH:mm:ss |
| Output Format | Enum | The desired format for the output datetime string. | YYYY-MM-DD HH:mm:ss |
| Years | Number | Number of years to add (use negative values to subtract). | 0 |
| Months | Number | Number of months to add (use negative values to subtract). | 0 |
| Days | Number | Number of days to add (use negative values to subtract). | 0 |
| Hours | Number | Number of hours to add (use negative values to subtract). | 0 |
| Minutes | Number | Number of minutes to add (use negative values to subtract). | 0 |
| Seconds | Number | Number of seconds to add (use negative values to subtract). | 0 |
Outputs
| Output | Type | Description |
|---|---|---|
| Output | Text | The adjusted datetime string in the specified output format. |
Runtime Behavior and Defaults
This is an uncontrolled node, meaning it executes immediately when data is available on its inputs and does not require an event trigger.
- Default Adjustments: All adjustment inputs (years, months, days, hours, minutes, seconds) default to
0if not connected or specified. - Default Formats: Both input and output formats default to
YYYY-MM-DD HH:mm:ss. - Arithmetic Logic:
- Years and months are applied first, with day clamping to handle month-end transitions (e.g., adding 1 month to January 31 results in February 28 or 29).
- Days are applied next as calendar day additions.
- Time components (hours, minutes, seconds) are applied last, with overflow carrying over to the next larger unit (e.g., 25 hours adds 1 day and sets hour to 1).
- Timezone Agnostic: The node treats all inputs as "wall-clock" time and does not perform any timezone conversions or UTC adjustments.
Example
Scenario: Calculate a date 3 months and 15 days from today.
- Connect a Datetime Now node (or a text node with a date) to the Input socket.
- Set Input Format to
YYYY-MM-DD HH:mm:ss(or match your input). - Set Months to
3. - Set Days to
15. - Set Output Format to
YYYY-MM-DDto get just the date.
Input: 2024-01-15 10:00:00
Result: 2024-04-30 (January 15 + 3 months = April 15, + 15 days = April 30)