Skip to main content

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:

FormatExample
YYYY-MM-DD2023-12-25
YYYY-MM-DD HH:mm:ss2023-12-25 14:30:00
YYYY-MM-DDTHH:mm:ss2023-12-25T14:30:00
YYYYMMDD20231225
YYYYMMDDHHmmss20231225143000
MM/DD/YYYY12/25/2023
DD/MM/YYYY25/12/2023
ISO2023-12-25T14:30:00

Inputs

InputTypeDescriptionDefault
InputTextThe datetime string to adjust. Must match the specified input format.-
Input FormatEnumThe format of the input datetime string.YYYY-MM-DD HH:mm:ss
Output FormatEnumThe desired format for the output datetime string.YYYY-MM-DD HH:mm:ss
YearsNumberNumber of years to add (use negative values to subtract).0
MonthsNumberNumber of months to add (use negative values to subtract).0
DaysNumberNumber of days to add (use negative values to subtract).0
HoursNumberNumber of hours to add (use negative values to subtract).0
MinutesNumberNumber of minutes to add (use negative values to subtract).0
SecondsNumberNumber of seconds to add (use negative values to subtract).0

Outputs

OutputTypeDescription
OutputTextThe 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 0 if 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.

  1. Connect a Datetime Now node (or a text node with a date) to the Input socket.
  2. Set Input Format to YYYY-MM-DD HH:mm:ss (or match your input).
  3. Set Months to 3.
  4. Set Days to 15.
  5. Set Output Format to YYYY-MM-DD to 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)