Date To String
This node formats a Date object into a readable text string.
The Date To String node converts timestamps into formats like "YYYY-MM-DD".
The Date To String node takes a Date object (or date string) and formats it according to a template string. It supports placeholders for year, month, day, hours, minutes, and seconds.
Inputs
General
| Data | Description |
|---|---|
| Date | The input date to format. Accepts Date objects or ISO date strings. |
| Format | The template string. Default: {year}-{month}-{date}. |
Outputs
Value
| Data | Description |
|---|---|
| Date String | The formatted text result. |
Signals
| Signal | Description |
|---|---|
| Date Changed | Triggered when the output updates. |
| Invalid Date | Triggered if the input cannot be parsed as a valid date. |
Usage
Formatting Options
Use these placeholders in the Format string:
{year}: 4-digit year (2023){yearShort}: 2-digit year (23){month}: 2-digit month (01-12){monthShort}: Short name (Jan, Feb){date}: 2-digit day (01-31){hours}: 2-digit hour (00-23){minutes}: 2-digit minute (00-59){seconds}: 2-digit second (00-59)
Example
Format: {date} {monthShort}, {year} at {hours}:{minutes}
Result: "15 Oct, 2023 at 14:30"
Detailed Behavior
- Locale: Uses
en-USfor month names currently. - Parsing: Attempts to parse strings using
new Date().
Troubleshooting
- Invalid Date: If the input string is malformed, the output will be empty and the Invalid Date signal will fire.