AdjustDate
Uncontrolled node
Overview
The AdjustDate node modifies a given date by adding or subtracting specified amounts of time (years, months, days, hours, minutes, and seconds). It accepts a date string as input and outputs the adjusted date formatted according to your specifications. This node is useful for calculating future or past dates, scheduling tasks, or manipulating timestamps within your workflow.
The node performs calendar-aware adjustments:
- Years and months are adjusted first to preserve calendar semantics (e.g., adding 1 month to January 31st results in February 28th/29th)
- Days, hours, minutes, and seconds are added as precise time durations after the calendar adjustments
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Input | Data | The base date to adjust. Accepts ISO 8601 strings, timestamps, or common date formats. | - |
| Years | Number | Number of years to add (positive) or subtract (negative). | 0 |
| Months | Number | Number of months to add (positive) or subtract (negative). | 0 |
| Days | Number | Number of days to add (positive) or subtract (negative). | 0 |
| Hours | Number | Number of hours to add (positive) or subtract (negative). | 0 |
| Minutes | Number | Number of minutes to add (positive) or subtract (negative). | 0 |
| Seconds | Number | Number of seconds to add (positive) or subtract (negative). | 0 |
Outputs
| Output | Type | Description |
|---|---|---|
| Output | Data | The adjusted date formatted as a string according to the selected format and timezone. Returns an error object if the input is invalid. |
Runtime Behavior and Defaults
The node runs automatically whenever any input changes (uncontrolled behavior). It parses the input date, applies the adjustments in the order: years → months → days → hours → minutes → seconds, then formats the result.
Format Options
| Format | Description | Example Output |
|---|---|---|
| YYYY-MM-DD | Standard ISO date | 2025-12-31 |
| YYYY-MM-DD HH:mm:ss | ISO date with time | 2025-12-31 14:30:00 |
| YYYY-MM-DDTHH:mm:ss | ISO 8601 format | 2025-12-31T14:30:00 |
| HH:mm:ss | Time only | 14:30:00 |
| MM/DD/YYYY | US date format | 12/31/2025 |
| DD/MM/YYYY | European date format | 31/12/2025 |
| YYYYMMDD | Compact date | 20251231 |
| YYYYMMDDHHmmss | Compact datetime | 20251231143000 |
| ISO | ISO 8601 with timezone | 2025-12-31T14:30:00Z |
| timestamp | Unix timestamp (milliseconds) | 1735653000000 |
| timestamp_s | Unix timestamp (seconds) | 1735653000 |
Timezone Handling
The node supports all standard IANA timezones (e.g., UTC, America/New_York, Europe/London, Asia/Tokyo). The default timezone is automatically detected from your browser settings, falling back to UTC if unavailable.
When adjusting dates across timezone boundaries or daylight saving time transitions, the node interprets the input as the specified timezone's local time and outputs the result in that same timezone.
Example Usage
Scenario: Calculate a subscription renewal date 1 year and 3 months from the current date.
- Connect a DatetimeNow node or provide a date string to the Input socket
- Set Years to
1and Months to3 - Leave Days, Hours, Minutes, and Seconds at
0(or connect Number nodes with value 0) - The Output will contain the future date formatted according to your selected format
Input Example:
- Input:
2025-01-15 10:00:00 - Years:
1 - Months:
3
Output: 2026-04-15 10:00:00 (assuming default format YYYY-MM-DD HH:mm:ss)
Negative Adjustments: To find a date 7 days in the past, set Days to -7 while keeping other adjustment values at 0.