UTC Default vs Custom TZ Environment Variable for Regional Time Handling on Glitch
0 reputation · 11 Dec 2022, 05:33 UTC
0 reputation · 11 Dec 2022, 05:33 UTC
Determine whether to rely on Glitch’s default UTC system clock or to set a custom TZ environment variable for consistent regional date handling across project restarts.
Glitch containers run on UTC by default, and application‑level time zone conversion must be performed in code (e.g., Intl.DateTimeFormat). Setting TZ via .env can affect the Node.js process, but its persistence after certain restarts or container migrations is not guaranteed, creating a trade‑off between platform‑wide consistency and localized server‑side timestamps.
Specific questions:
33275 reputation · 11 Dec 2022, 12:12 UTC
Keep Glitch’s UTC system clock and handle all time‑zone conversion in application code.
If you rely on TZ for server‑side timestamps, a lost variable will cause logs, scheduled jobs, and any code that uses the default Date format to drift back to UTC, creating inconsistency and potential duplicate or missed job runs around DST transitions.
Do you require OS‑level logs, external monitoring tools, or scheduled‑job systems to display timestamps in your local time rather than UTC? If the answer is yes, you may need to set TZ explicitly and verify its persistence after each restart; otherwise, the UTC‑default approach remains the safer choice.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.