Reference · Tools

Date & Time

Manipulate date and time values — format, parse, add, subtract, round, compare, and extract date parts.

Action Core Nodes v1

The Date & Time node lets you manipulate date and time values directly inside a BusyBot workflow — formatting, parsing, adding or subtracting durations, rounding, comparing, and extracting individual parts like day or month. No external API or credentials are required. A typical use is computing a subscription expiry date by adding 30 days to a signup timestamp, then formatting the result for a confirmation email.

Node type
Action
Parameters
26
Outputs
Output, Error
Credentials
None required

Date & Time

Manipulate date and time values

Overview

The Date & Time tool provides 7 date/time operations: getCurrentDate, addToDate, subtractFromDate, formatDate, roundDate, getTimeBetweenDates, and extractDate. Date handling is timezone-aware. Supports multiple input formats including ISO strings, Unix timestamps (seconds/milliseconds), and custom format strings.

Category: Core Nodes
Tool Name: date_time
Version: 1

Appearance: Icon: lucide-Calendar | Color: #408000

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool does not require any credentials.

Operations

OperationValueDescription
Add to a DateaddToDateMove a date forward by a number of time units
Extract Part of a DateextractDateRead a single component, such as the month, out of a date
Format a DateformatDateRender a date as a string in a chosen format
Get Current DategetCurrentDateProduce the current date and time
Get Time Between DatesgetTimeBetweenDatesMeasure the gap between two dates
Round a DateroundDateSnap a date to the start or end of a unit
Subtract From a DatesubtractFromDateMove a date backward by a number of time units

Parameters

Add to a Date (addToDate)

ParameterTypeRequiredDefaultDescription
Date (magnitude)stringYesThe date to add to. Accepts ISO strings, timestamps, or date expressions.
Time UnitoptionsNodaysThe time unit for the duration.
Options: years, quarters, months, weeks, days, hours, minutes, seconds, milliseconds
DurationnumberNo0The number of time units to add or subtract.
Output Field NamestringNonewDateName of the output field.

Extract Part of a Date (extractDate)

ParameterTypeRequiredDefaultDescription
Date (date)stringYesThe date to extract from.
PartoptionsNomonthThe part of the date to extract.
Options: year, month, week (ISO week number), day, hour, minute, second
Output Field NamestringNodatePartName of the output field.

Format a Date (formatDate)

ParameterTypeRequiredDefaultDescription
Date (date)stringYesThe date to format.
FormatoptionsNoMM/dd/yyyyThe format to output the date in.
Options: MM/dd/yyyy, yyyy/MM/dd, MMMM dd yyyy, MM-dd-yyyy, yyyy-MM-dd, X (Unix timestamp in seconds), x (Unix timestamp in milliseconds), custom
Custom FormatstringNoThe custom Luxon format string. (shown when Format is custom)
Output Field NamestringNoformattedDateName of the output field.

Get Current Date (getCurrentDate)

ParameterTypeRequiredDefaultDescription
Include TimebooleanNotrueWhether to include the time in the output or just the date (midnight).
Output Field NamestringNocurrentDateName of the output field to put the date value in.

Get Time Between Dates (getTimeBetweenDates)

ParameterTypeRequiredDefaultDescription
Start DatestringYesThe start date.
End DatestringYesThe end date.
UnitsmultiOptionsNo["days"]The units to calculate the difference in. Select more than one to split the gap across them.
Options: years, months, weeks, days, hours, minutes, seconds, milliseconds
Output Field NamestringNotimeDifferenceName of the output field.

Round a Date (roundDate)

ParameterTypeRequiredDefaultDescription
Date (date)stringYesThe date to round.
ModeoptionsNoroundDownWhether to round down (start of) or round up (end of + 1).
Options: roundDown, roundUp
To NearestoptionsNodayThe unit to round down to. (shown when Mode is roundDown)
Options: year, month, week, day, hour, minute, second
TooptionsNomonthThe unit to round up to. (shown when Mode is roundUp)
Options: month (end of month)
Output Field NamestringNoroundedDateName of the output field.

Subtract From a Date (subtractFromDate)

ParameterTypeRequiredDefaultDescription
Date (magnitude)stringYesThe date to subtract from.
Time UnitoptionsNodaysThe time unit for the duration.
Options: years, quarters, months, weeks, days, hours, minutes, seconds, milliseconds
DurationnumberNo0The number of time units to add or subtract.
Output Field NamestringNonewDateName of the output field.

All Operations

ParameterTypeRequiredDefaultDescription
OptionscollectionNo{}Shared parsing and output settings.
— Include Input FieldsbooleanNofalseWhether to include all input fields in the output alongside the result.
— TimezonestringNoThe timezone to use. If not set, UTC is used.
— From FormatstringNoThe Luxon format string of the input date (helps with parsing non-standard formats). (shown when Operation is formatDate)
— Output as ISO StringbooleanNofalseWhether to output the duration as an ISO 8601 duration string instead of an object. (shown when Operation is getTimeBetweenDates)
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

One output item per input item. Binary data is forwarded.

The output item starts empty. By default only the result field is present — the rest of the input JSON is dropped. Turn on Include Input Fields to copy the incoming fields through and add the result beside them. The result is written at Output Field Name, or at result if you clear that field.

OperationType of the result value
getCurrentDateISO 8601 string. With Include Time off, the time is midnight at the start of today.
addToDate, subtractFromDateISO 8601 string of the shifted date.
formatDateString in the chosen Format. X and x give the Unix timestamp in seconds and milliseconds. An empty input date yields null rather than an error.
roundDateISO 8601 string. roundDown snaps to the start of To Nearest; roundUp moves to the start of the next To unit.
getTimeBetweenDatesAn object with one key per selected unit, or an ISO 8601 duration string when Output as ISO String is on.
extractDateA number — the requested component. week gives the ISO week number.

With Include Input Fields on, a getTimeBetweenDates result looks like this:

{
  "startTime": "2024-01-01T00:00:00Z",
  "endTime": "2024-01-15T12:00:00Z",
  "timeDifference": {
    "days": 14,
    "hours": 12
  }
}

Reference the result downstream by expression, e.g. {{ $json.timeDifference.days }}.

Dates are read flexibly: ISO 8601 strings, Unix timestamps in seconds or milliseconds, and anything standard date parsing accepts. Set From Format when the input uses a layout that is ambiguous, such as dd/MM/yyyy. A value that cannot be parsed at all fails the item.

All operations work in UTC unless you set Timezone, which takes an IANA name such as America/New_York.

Usage Examples

  • Format a date to MM/DD/YYYY
  • Add 7 days to a date field
  • Get time between two dates in hours
  • Extract the month from a timestamp

Example Configuration

Get the current date and time in a specific timezone:

{
  "type": "date_time",
  "parameters": {
    "operation": "getCurrentDate",
    "includeTime": true,
    "outputFieldName": "currentDateTime",
    "options": {
      "includeInputFields": false,
      "timezone": "America/New_York"
    }
  }
}

Add seven days to a date, keeping the original fields:

{
  "type": "date_time",
  "parameters": {
    "operation": "addToDate",
    "magnitude": "2024-01-15T10:30:00Z",
    "timeUnit": "days",
    "duration": 7,
    "outputFieldName": "futureDate",
    "options": {
      "includeInputFields": true,
      "timezone": "UTC"
    }
  }
}

Format a date with a custom pattern:

{
  "type": "date_time",
  "parameters": {
    "operation": "formatDate",
    "date": "2024-01-15T10:30:00Z",
    "format": "custom",
    "customFormat": "yyyy-MM-dd HH:mm:ss",
    "outputFieldName": "formattedDate",
    "options": {
      "includeInputFields": false,
      "timezone": "America/Los_Angeles"
    }
  }
}

Round a timestamp down to the start of its day:

{
  "type": "date_time",
  "parameters": {
    "operation": "roundDate",
    "date": "2024-01-15T14:30:45Z",
    "mode": "roundDown",
    "toNearest": "day",
    "outputFieldName": "roundedDate"
  }
}

Measure a gap in days and hours:

{
  "type": "date_time",
  "parameters": {
    "operation": "getTimeBetweenDates",
    "startDate": "2024-01-01T00:00:00Z",
    "endDate": "2024-01-15T12:00:00Z",
    "units": ["days", "hours"],
    "outputFieldName": "timeDifference",
    "options": {
      "includeInputFields": true,
      "timezone": "UTC"
    }
  }
}

Pull the month number out of a timestamp:

{
  "type": "date_time",
  "parameters": {
    "operation": "extractDate",
    "date": "2024-01-15T14:30:45Z",
    "part": "month",
    "outputFieldName": "monthValue",
    "options": {
      "includeInputFields": false
    }
  }
}

Format a date taken from the incoming item:

{
  "type": "date_time",
  "parameters": {
    "operation": "formatDate",
    "date": "{{ $json.timestamp }}",
    "format": "MM/dd/yyyy",
    "outputFieldName": "displayDate"
  }
}

Calculate an expiry six months out:

{
  "type": "date_time",
  "parameters": {
    "operation": "addToDate",
    "magnitude": "{{ $json.createdAt }}",
    "timeUnit": "months",
    "duration": 6,
    "outputFieldName": "expiresAt"
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Manipulate dates: format, add/subtract, compare, round, extract parts — uses Luxon for timezone-aware operations.

Common Patterns

  • Basic date formatting — use formatDate with one of the predefined formats for common date representations.
  • Date arithmetic — use addToDate or subtractFromDate for scheduling and expiration calculations.
  • Timezone conversion — set Timezone in Options to render a UTC value in a local zone.
  • Date range calculations — use getTimeBetweenDates with the units your report needs, such as hours and minutes.

Notes

  • Turn Include Input Fields on whenever a downstream node still needs the rest of the item; otherwise the result field is all that survives.
  • formatDate only applies Timezone when you set it — leave it empty to format the date exactly as parsed.

Frequently asked questions

What operations does the Date & Time node actually support?

There are seven operations: getCurrentDate, addToDate, subtractFromDate, formatDate, roundDate, getTimeBetweenDates, and extractDate. These cover the most common scheduling, reporting, and formatting needs without chaining multiple nodes together.

What input formats does the node accept — do I need a clean ISO string?

No. The node accepts ISO strings, Unix timestamps in seconds, Unix timestamps in milliseconds, and custom format strings. If your upstream data returns a raw epoch number, you can pass it directly without a conversion step.

If I set a Timezone in Options, does it apply to every operation?

Not for formatDate specifically — the Timezone option only takes effect in formatDate when you explicitly set it. Leave it empty and the date is formatted exactly as parsed, with no zone shift applied. For other operations like addToDate or getTimeBetweenDates, setting Timezone makes the node render results in that local zone.

Will the node pass my other item fields downstream, or does it replace everything with just the date result?

By default only the result field survives; the rest of the item is dropped. Turn on Include Input Fields in the node's options if a downstream node still needs the original data — for example, if you need the user's email alongside the newly computed expiry date.

What happens if a date operation fails — is there any error handling built in?

Yes. The node has two outputs: Output and Error. If an operation fails — for instance, an unparseable date string — the item routes to the Error output instead of the main Output, so you can handle bad data separately without halting the whole workflow.

Build with the Date & Time node

Drop it into a workflow, wire it to an agent, or call it on a schedule.

Open BusyBot

Last updated . Spotted something wrong? Tell us.