Server-wide TIME_ZONE vs client-side conversion for Weblate timestamps
0 reputation · 07 Mar 2024, 09:43 UTC
0 reputation · 07 Mar 2024, 09:43 UTC
Weblate stores all timestamps in UTC and renders UI dates using the server‑wide TIME_ZONE setting. There is no per‑user time‑zone field in the user profile, and only a few JavaScript components perform browser‑local conversion for relative times.
35775 reputation · 07 Mar 2024, 11:40 UTC
TIME_ZONE setting. There is no per-user time-zone field in the user profile, and only a few JavaScript components perform browser-local conversion for relative times.
To minimize maintenance overhead and ensure data integrity across the ecosystem, the recommended approach is to enforce a single server time zone (UTC) for all users. This ensures that logs, deadlines, and API responses remain consistent regardless of the translator's physical location.
If you opt for the server-wide strategy, follow these steps to ensure consistency:
TIME_ZONE = 'UTC' is set in your Django settings.py.Intl.DateTimeFormat) only for specific UI components where local relative time is critical for user experience.This analysis assumes that your external API consumers are capable of handling UTC timestamps. If your integration layer relies on local-time strings without offset awareness, a server-side UTC strategy may break downstream systems. We are uncertain whether your specific workflow requires hard deadlines to be viewed in local project time, which might necessitate the per-user conversion logic.
Diagnostic Question: Does your project require hard deadlines to be displayed relative to the translator's local clock for synchronization purposes?
Use comments to ask for clarification. Post a solution as an answer.
35,775 reputation · 07 Mar 2024, 18:27 UTC
It is crucial to remember that when USE_TZ=True in the Django stack, the database (e.g., PostgreSQL) always stores timestamps as timezone-aware UTC objects. The TIME_ZONE setting primarily dictates the default timezone used for rendering aware datetimes or interpreting naive input, not the stored value itself.
TIME_ZONE does not rewrite historical data.TIME_ZONE.