节点 / builtin / datatransformation / datetime
Format Date
Format a date
此内容尚不支持你的语言。
Turn a date into text in a fixed format, or into a Unix timestamp.
What it does
Section titled “What it does”Format Date reads Date to format and writes it as text in the field named by Output field name, using one of these Format choices:
| Format | Example for 5 March 2026 |
|---|---|
| MM/DD/YYYY | 03/05/2026 |
| YYYY/MM/DD | 2026/03/05 |
| MMMM DD YYYY | March 05 2026 |
| MM-DD-YYYY | 03-05-2026 |
| YYYY-MM-DD | 2026-03-05 |
| DD/MM/YYYY | 05/03/2026 |
| DD-MM-YYYY | 05-03-2026 |
| Unix Timestamp | Seconds since 1 January 1970, for example 1772668800 at midnight UTC |
| Unix MS Timestamp | Milliseconds since 1 January 1970 |
Dates are formatted in your computer’s local time zone. Month names are in English. The result is always text, including the timestamps.
When to use it
Section titled “When to use it”- Show a date in a message, a sheet or a notification in a readable way.
- Send a date to an API that expects
YYYY-MM-DDor a Unix timestamp. - Build file names that sort by date, such as
report-2026-03-05.
Inputs and settings
Section titled “Inputs and settings”| 设置项 | 类型 | 作用 |
|---|---|---|
| Date to format (必填) | Date and time | The date to format. |
| Format (必填) | Choice | The format to use for the date. Options: MM/DD/YYYY, YYYY/MM/DD, MMMM DD YYYY, MM-DD-YYYY, YYYY-MM-DD, DD/MM/YYYY, DD-MM-YYYY, Unix Timestamp, Unix MS Timestamp. |
| Output field name (必填) | Text | The name of the output field. |
| Options | Group | The options for the node. |
| Options › Include input fields | Toggle | Whether to include the input fields in the output. 默认值:Off |
Date to format accepts a picked date or an expression such as {{ $input.createdAt }}. Only the listed formats are available; there is no free-form pattern or time-of-day format.
Outputs
Section titled “Outputs”-
Output
The item holds the formatted text under Output field name, for example { day: "2026-03-05" }. Turn on Include input fields to keep the incoming fields too.
Dependencies and credentials
Section titled “Dependencies and credentials”None. This node needs no connection and has no slots for other nodes.
Example workflow
Section titled “Example workflow”Save selected text into a dated file:
- Context Menu trigger, Menu Contexts
Selection. - Get Current Date, Output field name
now, Include input fields on. - Format Date, Date to format
{{ $input.now }}, FormatYYYY-MM-DD, Output field nameday, Include input fields on. - Save as File, Content
{{ $input.selectionText }}, File namenotes-{{ $input.day }}, File typetxt.
Common issues
Section titled “Common issues”- The output says “Invalid Date”. The incoming value is not a date the browser can read. Use an ISO date such as
2026-03-05or2026-03-05T09:30:00Z. - The date is one day off. A UTC time near midnight moved to the previous or next day in your local time zone. Include the time and time zone in the input.
- A later number comparison fails on the timestamp. The timestamp formats return text, not a number. Compare it as text, or set the field type to Number in the comparing node.
Related nodes
Section titled “Related nodes”- Get Current Date: get “now” to format.
- Extract Part Of A Date: get a single number such as the year.
- Text / Formatter: combine the date with other text.