fix(core): Fix execution startedAt timezone issue with PostgreSQL#25054
fix(core): Fix execution startedAt timezone issue with PostgreSQL#25054newbee1939 wants to merge 1 commit inton8n-io:masterfrom
Conversation
Pass Date object to setParameter() instead of converting to string via DateUtils.mixedDateToUtcDatetimeString(). The string lacks timezone info, so PostgreSQL misinterprets it when not using UTC timezone.
|
Hey @newbee1939, Thank you for your contribution. We appreciate the time and effort you’ve taken to submit this pull request. Before we can proceed, please ensure the following: Regarding new nodes: If your node integrates with an AI service that you own or represent, please email nodes@n8n.io and we will be happy to discuss the best approach. About review timelines: Thank you again for contributing to n8n. |
|
would be great to get this merged, I had this issue crop up in my self-hosted n8n instance using Postgres. here's my forum post if that helps get a review faster. i've had to rollback my version and hold off on latest updates. |
|
+1 experiencing this issue. Subscribed. |
|
Thank you for bringing this up. I'm also experiencing this in production. |
|
+1 I'm also running into this! |
|
I'm also running into this... |
|
after checking out issue #25465 i tried updating to the latest version and my issue has been resolved! specifically, i updated to v2.8.1, and now my execution times are accurate again. |


Summary
This PR fixes a bug introduced in v2.5.0 where execution timestamps (
startedAt) were incorrectly stored in PostgreSQL when the database is configured for a non-UTC timezone (e.g.,Asia/Tokyo).Problem
Following the changes in #23146, the storage logic for
startedAtwas modified to useDateUtils.mixedDateToUtcDatetimeString. This helper explicitly convertsDateobjects to a UTC string before persistence.In environments where PostgreSQL is set to a local timezone like JST (UTC+9), this causes a discrepancy:
2026-01-30 22:50:00 JSTstored as2026-01-30 22:50:00+09.13:50:00is stored as2026-01-30 13:50:00+09, resulting in a 9-hour offset in the UI.Solution
I have reverted the logic to pass the
Dateobject directly to the query builder. This allows the database driver to handle the timezone conversion naturally based on the system/database configuration, restoring the original and correct behavior.Related Linear tickets, Github issues, and Community forum posts
#23146
Review / Merge checklist
release/backport(if the PR is an urgent fix that needs to be backported)