Describe the problem/error/question
I’m seeing inconsistent behavior when determining the local week number on a locally
hosted, community-registered n8n instance.
This occurs when using both of the following approaches in a Set node:
-
Direct property access:
{{ $now.localWeekNumber }} -
The format() method with the ‘n’ argument:
{{ $now.format(‘n’) }}
In both cases:
- The Set node preview shows the value as 3 (which matches the actual local calendar week)
- The workflow execution outputs the value as 4 (which is the ISO week number)
The preview and execution appear to be evaluating the same expression but are returning
different values. I’ve attached a screenshot showing the preview value and execution output
side-by-side.
My locale is en-CA, and the system timezone and locale are set correctly. See screenshot below:
Please share your workflow
Share the output returned by the last node
[
{
"localWeekNumber": 4,
"timestamp": "2026-01-21T16:55:41.930-08:00",
"today": "2026-01-21T00:00:00.000-08:00",
"tomorrow": "2026-01-22T00:00:00.000-08:00",
"startOfWeek": "2026-01-18T00:00:00.000-08:00",
"endOfWeek": "2026-01-24T23:59:59.999-08:00",
"localWeekYear": 2026
}
]
Information on your n8n setup
- n8n version: 2.0.3
- Database (default: SQLite): default SQLite
- n8n EXECUTIONS_PROCESS setting (default: own, main): default
- Running n8n via (Docker, npm, n8n cloud, desktop app): docker compose
- Operating system: Raspberry Pi OS (64-bit) (Linux)
