// guides · n8n error index

n8n timezone or date wrong? GENERIC_TIMEZONE, $now and Luxon, tested

Why n8n shows the wrong time: $now uses America/New_York unless GENERIC_TIMEZONE or the workflow timezone is set, and TZ alone does nothing. Plus the Luxon format and parsing mistakes behind wrong dates, from 5 real setups on n8n 2.43.7.

Updated 2026-10-23 · about 10 minutes

Still stuck after these steps? Paste your exact n8n error and we'll reproduce it and email you the fix, free →

Steps

  1. 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.

  2. Set GENERIC_TIMEZONE on the n8n process

    For example GENERIC_TIMEZONE=Europe/Paris in your Docker or systemd environment, then restart n8n. $now, $today and the Schedule Trigger follow it. Setting only TZ did not change $now in our test.

  3. 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.

  4. Fix the format string

    Luxon is case-sensitive: MM is month, mm is minutes, yyyy is the year. yyyy-mm-dd gave us 2026-05-23 (05 was the minute) and YYYY was printed literally.

  5. Parse non-ISO dates explicitly

    '23/10/2026'.toDateTime() failed with cannot convert to Luxon DateTime. Use DateTime.fromFormat('23/10/2026', 'dd/MM/yyyy'), and fromSeconds (not fromMillis) 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 set2026-10-22T21:33:50-04:00 (the previous day!)America/New_York
GENERIC_TIMEZONE=Europe/Paris2026-10-23T03:33:50+02:00Europe/Paris
GENERIC_TIMEZONE=Europe/Paris + workflow timezone Asia/Tokyo2026-10-23T10:33:49+09:00Asia/Tokyo
Only TZ=Europe/Paris2026-10-22T21:33:49-04:00America/New_York (unchanged)
Only workflow timezone Asia/Tokyo2026-10-23T10:33:50+09:00Asia/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 wroteWhat n8n gaveFix
{{ '23/10/2026'.toDateTime() }}Node error: cannot convert to Luxon DateTimeDateTime.fromFormat($json.date, 'dd/MM/yyyy')
DateTime.fromISO('23/10/2026') in a Code nodeInvalid DateTime, reason unparsable, no error thrownSame fromFormat; check .isValid
'2026-10-23'.toFormat('yyyy') in a Code node"2026-10-23".toFormat is not a functionTurn 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:052026-05-23yyyy-MM-dd (mm is minutes)
.toFormat('YYYY-MM-dd')YYYY-12-30yyyy (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 DateTimeUse 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 offsetAdd .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

What we didn't test

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

New guides

Still stuck on your n8n error?

Paste the exact error and say what the workflow should do. We reproduce it on a real n8n install and email you the fix or a working workflow, usually within 24h. Free while we're in beta.

We'll only email you about your error and TaskToAgent.