Heroku TZ environment variable limits regarding database timestamp synchronization
0 reputation · 06 Oct 2022, 23:54 UTC
TZ environment variable via application config alters how the runtime interprets relative date-time strings, this configuration is isolated to the dyno environment.
There is a potential synchronization discrepancy between the application's local time interpretation and the configuration of managed data services like PostgreSQL. If the application generates a timestamp based on a regional TZ setting, the database may still store or query that value using its internal UTC logic regardless of the dyno's offset.
How does the TZ variable affect the behavior of database drivers when persisting objects without explicit UTC offsets? Is there a risk of data drift when the application-level timezone is changed while the underlying managed database remains in default UTC mode?