Steps
Check which zone n8n thinks it is in
Put
{{ $now.zoneName }}in an Edit Fields node. On our server, whose clock was set to Africa/Casablanca, n8n still said America/New_York: that is n8n's default, not your server's.Set GENERIC_TIMEZONE on the n8n process
For example
GENERIC_TIMEZONE=Europe/Parisin your Docker or systemd environment, then restart n8n.$now,$todayand the Schedule Trigger follow it. Setting onlyTZdid not change$nowin our test.Or set it per workflow
Workflow Settings, Timezone. In our test a workflow set to Asia/Tokyo used Tokyo time even with
GENERIC_TIMEZONE=Europe/Paris: the workflow setting wins.Fix the format string
Luxon is case-sensitive:
MMis month,mmis minutes,yyyyis the year.yyyy-mm-ddgave us2026-05-23(05 was the minute) andYYYYwas printed literally.Parse non-ISO dates explicitly
'23/10/2026'.toDateTime()failed withcannot convert to Luxon DateTime. UseDateTime.fromFormat('23/10/2026', 'dd/MM/yyyy'), andfromSeconds(notfromMillis) for 10-digit Unix timestamps.
What we ran
On 23 October 2026 we ran the same workflow (Manual Trigger, a Code node, then an Edit Fields node full of date expressions) with n8n execute on n8n 2.43.7, in five setups. The server's own clock zone was Africa/Casablanca (UTC+0) in all of them. The run started at 01:33 UTC.
| Setup | $now came out as | $now.zoneName |
|---|---|---|
| Nothing set | 2026-10-22T21:33:50-04:00 (the previous day!) | America/New_York |
GENERIC_TIMEZONE=Europe/Paris | 2026-10-23T03:33:50+02:00 | Europe/Paris |
GENERIC_TIMEZONE=Europe/Paris + workflow timezone Asia/Tokyo | 2026-10-23T10:33:49+09:00 | Asia/Tokyo |
Only TZ=Europe/Paris | 2026-10-22T21:33:49-04:00 | America/New_York (unchanged) |
| Only workflow timezone Asia/Tokyo | 2026-10-23T10:33:50+09:00 | Asia/Tokyo |
So the order is: workflow timezone, then GENERIC_TIMEZONE, then America/New_York. $today followed the same zone (with nothing set it was 2026-10-22T00:00:00-04:00, a day behind the UTC date). Plain JavaScript new Date().toString() inside the Code node ignored all of this and always used the server clock, even with TZ=Europe/Paris; in an expression it did follow TZ. Use $now, not new Date(), when the zone matters.
Date mistakes we reproduced
| What we wrote | What n8n gave | Fix |
|---|---|---|
{{ '23/10/2026'.toDateTime() }} | Node error: cannot convert to Luxon DateTime | DateTime.fromFormat($json.date, 'dd/MM/yyyy') |
DateTime.fromISO('23/10/2026') in a Code node | Invalid DateTime, reason unparsable, no error thrown | Same fromFormat; check .isValid |
'2026-10-23'.toFormat('yyyy') in a Code node | "2026-10-23".toFormat is not a function | Turn the string into a date first: DateTime.fromISO('2026-10-23').toFormat('yyyy') |
Same in an expression {{ '2026-10-23'.toFormat('yyyy') }} | An empty value (null), no error | {{ '2026-10-23'.toDateTime().toFormat('yyyy') }} |
.toFormat('yyyy-mm-dd') at 10:05 | 2026-05-23 | yyyy-MM-dd (mm is minutes) |
.toFormat('YYYY-MM-dd') | YYYY-12-30 | yyyy (Luxon has no YYYY) |
DateTime.fromMillis(1761213600) (a timestamp in seconds) | 1970-01-21… | DateTime.fromSeconds(1761213600), or multiply by 1000 |
$now.setZone('Paris') | Invalid DateTime | Use the full IANA name: $now.setZone('Europe/Paris') |
DateTime.fromISO('2026-10-23T10:00:00') (no Z, no offset) | Read as 10:00 in the workflow zone (-04:00 by default) | Add Z or an offset if the source is UTC |
DateTime.fromISO('2026-10-23T10:00:00Z') then toFormat('HH:mm') | Converted to the workflow zone: 06:00 (New York), 12:00 (Paris), 19:00 (Tokyo) | Expected; add .toUTC() to keep UTC |
{{ '2026-10-23T10:00:00Z'.toDateTime().toFormat('HH:mm') }} | 10:00 in every setup: it kept the string's own offset | Add .setZone($now.zoneName) to show local time |
Snippets that worked in every setup
// Expression: local date for a file name or email subject
{{ $now.toFormat('yyyy-MM-dd') }}
// Expression: an incoming UTC string shown in the workflow's zone
{{ $json.created_at.toDateTime().setZone($now.zoneName).toFormat('dd/MM/yyyy HH:mm') }}
// Code node: parse a European date safely
const d = DateTime.fromFormat($json.date, 'dd/MM/yyyy');
if (!d.isValid) throw new Error('Bad date: ' + $json.date + ' (' + d.invalidReason + ')');
return [{ json: { iso: d.toISODate(), daysLeft: Math.round(d.diff($today, 'days').days) } }];
Good to know
- Using the Date & Time node instead of expressions? Its own traps (Invalid date format, 03/04 read as March, lost fields, UTC output) are in n8n Date & Time node not working.
- A Schedule Trigger that fires at the wrong hour is the same zone problem; see n8n Schedule Trigger not working.
- Expressions that come out empty or undefined for other reasons: n8n expression errors. Code node return errors: n8n Code node errors.
- Every error text from our n8n guides is in the n8n error message index.
What we didn't test
- The Date & Time node, the editor UI's own clock display, and n8n Cloud (where the instance timezone is set in the admin panel). We used the CLI on a self-hosted install with task runners off.
- Daylight-saving changeovers. Our runs were on one night, so offsets are the ones in force on 23 October 2026.
Start from a working agent
FAQ
Why is the time wrong in n8n?
n8n uses its own timezone, America/New_York by default, not the server clock. In our test on a server set to Africa/Casablanca, $now still came out in New York time, a day behind just after midnight UTC. Set GENERIC_TIMEZONE or the workflow's Timezone setting.
Does TZ change the n8n timezone?
Not for $now. With only TZ=Europe/Paris, $now stayed America/New_York in our run. GENERIC_TIMEZONE changed it, and the workflow Timezone setting overrode GENERIC_TIMEZONE.
How do I format a date in n8n?
Use Luxon: {{ $now.toFormat('yyyy-MM-dd HH:mm') }}. MM is month and mm is minutes, and Luxon has no YYYY. A string needs .toDateTime() first, or DateTime.fromISO in a Code node.
What does 'cannot convert to Luxon DateTime' mean in n8n?
toDateTime() couldn't read the string, for example '23/10/2026'. Parse it with an explicit format: DateTime.fromFormat($json.date, 'dd/MM/yyyy').
Why does my n8n date show 1970?
The timestamp is in seconds but was read as milliseconds. DateTime.fromMillis(1761213600) gave 1970-01-21; DateTime.fromSeconds(1761213600) gave the right date.
Related guides
- n8n Date & Time node not working: Invalid date format, wrong day and lost fields, 41 runs
- n8n Schedule Trigger not firing? Timezone, publishing, cron and 4 more causes we tested
- n8n Switch node not working: missing items, wrong output and type errors, 30 runs
- n8n Filter node not working: items removed, type errors and empty checks, 32 runs
- n8n webhook not working? Test URL vs production URL and every 404 explained
New guides
- GitHub release notifications in Slack (any public repo, stable releases only)
- Send RSS feeds to Slack with a keyword filter (free, incoming webhook)
- Forward emails to a Slack channel (Gmail, Outlook, any IMAP), free with an incoming webhook
- n8n Google Sheets Trigger not working: not firing, activation errors and fixes