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:
| Format | Description | Example Output |
|---|---|---|
| YYYY-MM-DD | Standard ISO date | 2025-01-15 |
| YYYY-MM-DD HH:mm:ss | Standard ISO datetime with time | 2025-01-15 14:30:00 |
| YYYY-MM-DDTHH:mm:ss | ISO 8601 datetime (T separator) | 2025-01-15T14:30:00 |
| HH:mm:ss | Time only | 14:30:00 |
| MM/DD/YYYY | US date format | 01/15/2025 |
| DD/MM/YYYY | European date format | 15/01/2025 |
| YYYYMMDD | Compact date | 20250115 |
| YYYYMMDDHHmmss | Compact datetime | 20250115143000 |
| YYYY-MM | Year and month | 2025-01 |
| YYYY | Year only | 2025 |
| DD MMM YYYY | Day Month Year (abbreviated) | 15 Jan 2025 |
| MMM DD, YYYY | Month Day, Year | Jan 15, 2025 |
| DD MMMM YYYY | Day Month Year (full) | 15 January 2025 |
| MMMM DD, YYYY | Month Day, Year (full) | January 15, 2025 |
| ISO | ISO 8601 with timezone | 2025-01-15T14:30:00Z |
| timestamp | Unix timestamp (milliseconds) | 1736958600000 |
| timestamp_s | Unix timestamp (seconds) | 1736958600 |
Inputs
| Input | Type | Description | Default |
|---|---|---|---|
| Input | Data | The date/time value to format. Accepts Date objects, numbers (milliseconds), or strings (ISO 8601, YYYY-MM-DD, etc.). If empty, uses current time. | — |
Outputs
| Output | Type | Description |
|---|---|---|
| Output | Data | The 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:
- Empty input: Uses the current date/time (
new Date()) - Date object: Used directly
- Number: Treated as milliseconds since epoch (or seconds if
timestamp_sformat is detected in input) - 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)
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:
- Connect a Variable node containing a Unix timestamp (e.g.,
1736958600000) to the Input of the Datetime node. - Set the Format property to
DD MMM YYYY. - The Output will contain
15 Jan 2025.
Getting current time:
- Leave the Input disconnected (or connect an empty value).
- Set the Format to
HH:mm:ss. - The node will output the current time (e.g.,
14:30:00) whenever the workflow runs.