Skip to main content

Datetime

Uncontrolled node

Overview

The Datetime node formats date and time values into various string representations. It automatically parses multiple input types—including JavaScript Date objects, Unix timestamps (in milliseconds or seconds), ISO 8601 strings, and common date formats—and converts them to a specified output format. If no input is provided, the node outputs the current date and time.

This node is timezone-aware and will convert the input time to the specified output timezone before formatting.

Format Options

The following output formats are available:

FormatDescriptionExample Output
YYYY-MM-DDStandard ISO date2025-01-15
YYYY-MM-DD HH:mm:ssStandard ISO datetime with time2025-01-15 14:30:00
YYYY-MM-DDTHH:mm:ssISO 8601 datetime (T separator)2025-01-15T14:30:00
HH:mm:ssTime only14:30:00
MM/DD/YYYYUS date format01/15/2025
DD/MM/YYYYEuropean date format15/01/2025
YYYYMMDDCompact date20250115
YYYYMMDDHHmmssCompact datetime20250115143000
YYYY-MMYear and month2025-01
YYYYYear only2025
DD MMM YYYYDay Month Year (abbreviated)15 Jan 2025
MMM DD, YYYYMonth Day, YearJan 15, 2025
DD MMMM YYYYDay Month Year (full)15 January 2025
MMMM DD, YYYYMonth Day, Year (full)January 15, 2025
ISOISO 8601 with timezone2025-01-15T14:30:00Z
timestampUnix timestamp (milliseconds)1736958600000
timestamp_sUnix timestamp (seconds)1736958600

Inputs

InputTypeDescriptionDefault
InputDataThe date/time value to format. Accepts Date objects, numbers (milliseconds), or strings (ISO 8601, YYYY-MM-DD, etc.). If empty, uses current time.

Outputs

OutputTypeDescription
OutputDataThe formatted date/time string according to the selected format. Returns empty string if input cannot be parsed.

Runtime Behavior and Defaults

The Datetime node runs automatically whenever its input data changes (uncontrolled behavior). It attempts to parse the input using the following rules:

  1. Empty input: Uses the current date/time (new Date())
  2. Date object: Used directly
  3. Number: Treated as milliseconds since epoch (or seconds if timestamp_s format is detected in input)
  4. String: Parsed as ISO 8601, YYYY-MM-DD, YYYYMMDD, DD/MM/YYYY, MM/DD/YYYY, or other common formats

Default Settings:

  • Format: YYYY-MM-DD HH:mm:ss
  • Timezone: Defaults to the browser's local timezone (or UTC if unavailable)
Input Flexibility

The node automatically detects the input format. For example, you can pass a Unix timestamp from a database, an ISO string from an API, or a Date object from another node without needing conversion nodes.

Example

Formatting a timestamp for display:

  1. Connect a Variable node containing a Unix timestamp (e.g., 1736958600000) to the Input of the Datetime node.
  2. Set the Format property to DD MMM YYYY.
  3. The Output will contain 15 Jan 2025.

Getting current time:

  1. Leave the Input disconnected (or connect an empty value).
  2. Set the Format to HH:mm:ss.
  3. The node will output the current time (e.g., 14:30:00) whenever the workflow runs.