Skip to content

Add To A Date

The Add To A Date node provides comprehensive date arithmetic capabilities for adding multiple time periods to existing dates. This node handles complex date calculations including timezone conversions, business day arithmetic, and flexible time unit operations, making it essential for scheduling, deadline calculations, and temporal workflow.

Add To A Date serves as a powerful date arithmetic tool that allows you to:

  • Add days, weeks, months, years, hours, minutes, or seconds to dates
  • Handle timezone conversions and daylight saving time transitions
  • Calculate business days excluding weekends and holidays
  • Support multiple date input formats and output formatting
  • Perform batch date calculations for multiple dates simultaneously
timeline
    title Date Addition Process

    section Input Processing
        Parse Input Date    : Validate format
                           : Handle timezone
                           : Convert to standard format

        Configure Addition  : Set time unit
                           : Set amount to add
                           : Apply business rules

    section Calculation
        Date Arithmetic     : Add time period
                           : Handle month/year boundaries
                           : Account for leap years

        Business Day Logic  : Skip weekends
                           : Exclude holidays
                           : Adjust final date

    section Output
        Format Result      : Apply timezone conversion
                          : Format output string
                          : Include metadata
  • Flexible Time Units: Support for years, months, weeks, days, hours, minutes, and seconds
  • Timezone Awareness: Automatic timezone handling and conversion capabilities
  • Business Day Calculations: Skip weekends and custom holiday lists
  • Multiple Date Formats: Accept and output dates in multiple standard formats
  • Batch Processing: Process multiple dates in a single operation
  • Deadline Calculations: Calculate project deadlines and milestone dates
  • Scheduling Automation: Generate future appointment and event dates
  • Subscription Management: Calculate renewal dates and expiration periods
  • Business Logic: Implement time-based business rules and workflows
ParameterTypeDescriptionExample
input_datestring/dateBase date to add time to"2024-01-15T10:00:00Z"
amountnumberAmount of time units to add30
unitstringTime unit: “years”, “months”, “weeks”, “days”, “hours”, “minutes”, “seconds”"days"
ParameterTypeDefaultDescriptionExample
timezonestring"UTC"Target timezone for calculations"America/New_York"
business_days_onlybooleanfalseSkip weekends in day calculationstrue
holidaysarray[]List of holiday dates to skip["2024-12-25", "2024-01-01"]
output_formatstring"ISO"Output format: “ISO”, “timestamp”, “custom”"YYYY-MM-DD"
{
"input_date": "2024-01-15T09:00:00",
"amount": 5,
"unit": "days",
"timezone": "America/New_York",
"business_days_only": true,
"holidays": [
"2024-01-15",
"2024-02-19",
"2024-12-25"
],
"output_format": "YYYY-MM-DD HH:mm:ss",
"weekend_days": [0, 6],
"custom_rules": {
"end_of_month_handling": "preserve_day",
"leap_year_handling": "standard"
}
}
{
"date": "2024-01-15T10:00:00Z",
"addition_config": {
"amount": 30,
"unit": "days",
"business_days_only": false
},
"timezone_info": {
"input_timezone": "UTC",
"output_timezone": "America/New_York"
}
}
{
"original_date": "2024-01-15T10:00:00Z",
"result_date": "2024-02-14T05:00:00-05:00",
"calculation_details": {
"amount_added": 30,
"unit": "days",
"business_days_skipped": 0,
"holidays_skipped": 0,
"timezone_applied": "America/New_York"
},
"metadata": {
"calculation_time": 15,
"input_format": "ISO",
"output_format": "ISO",
"dst_transition": false
}
}

Scenario: Calculate a project deadline 30 days from the start date

Configuration:

{
"input_date": "2024-01-15T09:00:00Z",
"amount": 30,
"unit": "days",
"output_format": "YYYY-MM-DD"
}

Input Data:

{
"project_start": "2024-01-15T09:00:00Z"
}

Expected Output:

{
"original_date": "2024-01-15T09:00:00Z",
"result_date": "2024-02-14",
"calculation_details": {
"amount_added": 30,
"unit": "days",
"business_days_skipped": 0,
"holidays_skipped": 0
}
}

Example 2: Business Day Calculation with Holidays

Section titled “Example 2: Business Day Calculation with Holidays”

Scenario: Calculate a business deadline excluding weekends and holidays

Configuration:

{
"input_date": "2024-01-15T09:00:00",
"amount": 10,
"unit": "days",
"business_days_only": true,
"holidays": ["2024-01-15", "2024-02-19"],
"timezone": "America/New_York"
}

Workflow Integration:

graph LR
    A[Project Creation] --> B[Add To A Date Node]
    B --> C[Calendar Integration]

    A --> A1[Project Start Date
2024-01-15] A1 --> B B --> B1[Add 10 Business Days] B --> B2[Skip Weekends] B --> B3[Exclude Holidays] B1 --> C B2 --> C B3 --> C C --> C1[Deadline Date
2024-01-31] C --> C2[Calendar Event] C --> C3[Team Notification] subgraph "Business Rules" D[Weekend Exclusion] E[Holiday Calendar] F[Timezone Handling] end B --> D B --> E B --> F style B fill:#fff3e0 style C1 fill:#e8f5e8

Complete Example:

{
"input": {
"project_start": "2024-01-15T09:00:00",
"business_requirements": {
"exclude_weekends": true,
"company_holidays": ["2024-01-15", "2024-02-19"]
}
},
"processing": {
"days_to_add": 10,
"business_days_only": true,
"skipped_dates": ["2024-01-15", "2024-01-20", "2024-01-21"]
},
"output": {
"deadline": "2024-01-31T09:00:00-05:00",
"working_days_calculated": 10,
"calendar_days_spanned": 16
}
}

This example demonstrates the fundamental usage of the AddToADate node in a typical workflow scenario.

Configuration:

{
"date": "example_value",
"format": true
}

Input Data:

{
"data": "sample input data"
}

Expected Output:

{
"result": "processed output data"
}

This example shows more complex configuration options and integration patterns.

Configuration:

{
"parameter1": "advanced_value",
"parameter2": false,
"advancedOptions": {
"option1": "value1",
"option2": 100
}
}

Example showing how this node integrates with other workflow nodes:

  1. Previous NodeAddToADateNext Node
  2. Data flows through the workflow with appropriate transformations
  3. Error handling and validation at each step
  • Nodes: Date Input → Add To A Date → Format Date → Calendar API
  • Use Case: Create scheduled events with calculated dates
  • Configuration Tips: Use business_days_only for work-related scheduling
  • Nodes: User Registration → Add To A Date → Database Update → Email Notification
  • Use Case: Calculate subscription renewal dates
  • Data Flow: Registration date → renewal date → stored date → notification
  • Performance: Use batch processing for multiple date calculations
  • Error Handling: Validate input dates before performing calculations
  • Data Validation: Ensure timezone strings are valid IANA timezone identifiers
  • Resource Management: Cache holiday lists to avoid repeated API calls
  • Symptoms: Incorrect date results or timezone-related errors
  • Causes: Invalid timezone identifiers or daylight saving time transitions
  • Solutions:
    1. Use valid IANA timezone identifiers (e.g., “America/New_York”)
    2. Handle DST transitions by checking metadata.dst_transition
    3. Test calculations around DST change dates
  • Prevention: Validate timezone strings and test with DST edge cases

Issue: Business Day Calculation Inconsistencies

Section titled “Issue: Business Day Calculation Inconsistencies”
  • Symptoms: Unexpected results when excluding weekends and holidays
  • Causes: Overlapping weekend and holiday exclusions or incorrect holiday formats
  • Solutions:
    1. Ensure holiday dates are in YYYY-MM-DD format
    2. Check weekend_days configuration (0=Sunday, 6=Saturday)
    3. Verify holiday list doesn’t include weekends unless intended
  • Prevention: Use standardized holiday date formats and test with known dates
  • Slow Calculations: Reduce the number of holidays in the list or use caching
  • Memory Usage: Process large date arrays in batches rather than all at once
  • Timezone Lookups: Cache timezone data for frequently used timezones
  • Date Range: Supports dates from 1900-01-01 to 2100-12-31
  • Precision: Calculations accurate to the second level
  • Historical Data: Timezone rules may not be accurate for historical dates before 1970
  • Future Changes: Timezone rule changes may affect future date calculations
  • Browser Support: Some older browsers may have limited timezone support
  • Input Size: Maximum 1000 dates per batch operation
  • Holiday List: Maximum 100 holidays per calculation
  • Processing Time: Complex calculations timeout after 30 seconds

Field Transformation: Process of modifying data field names, types, or values

Type Conversion: Converting data from one type to another (string, number, boolean, etc.)

Data Validation: Process of ensuring data meets specified criteria and constraints

Schema: Structure definition that describes the format and constraints of data

Serialization: Process of converting data structures into a format for storage or transmission

  • data processing
  • field manipulation
  • type conversion
  • data validation
  • formatting
  • transformation
  • “transform”
  • “convert”
  • “format”
  • “edit”
  • “modify”
  • “process”
  • “validate”
  • “clean”
  • “restructure”
  • data cleaning
  • format conversion
  • field manipulation
  • data validation
  • report generation
  • data processing
  • SubstractFromDate: Use when you need different approach to similar functionality
  • GetTimeBetweenDates: Use when you need different approach to similar functionality
  • GetCurrentDate: Works well together in workflows
  • FormatDate: Works well together in workflows
  • EditFields: Works well together in workflows
  • GetCurrentDate → AddToADate → FormatDate: Common integration pattern
  • EditFields → AddToADate → DownloadAsFile: Common integration pattern

Decision Guides:

General Resources: