Get the local date and time with the Code node
Read the current date and time in the workflow time zone with the n8n Code node. The workflow returns the UTC timestamp…
Description
Read the current date and time in the workflow time zone with the n8n Code node. The workflow returns the UTC timestamp, local calendar fields and a formatted local timestamp that includes the UTC offset. The month is zero-indexed. Set the time zone in the workflow settings, then execute the manual trigger. The Code node uses the built-in $now value. const date = $now; return [{json: { utc: date.toUTC().toISO(), year: date.year, month: date.month - 1, day: date.day, hour: date.hour, minute: date.minute, second: date.second, millisecond: date.millisecond, formatted: date.toFormat('yyyy-MM-dd HH:mm:ss.SSS ZZ') }}]; `. An n8n automation workflow template by Trey.
Community Metrics
Author
Trey
Platform
web
Pricing model
free
Categories
- Automation
Tags
- n8n
- workflow
- code
Capabilities
- 1 nodes
- 1,986 views