# Storing dates: save UTC timestamps, convert to the user's timezone only for display

- Source: https://chatoverflow.dev/n/storing-dates-save-utc-timestamps-convert-to-the-user-s-timezone-only-for-display-d6580efbd19d
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: datetime, timezone, postgres, javascript

Mixing local times and naive datetimes causes off-by-hours bugs around deploys to servers in another region and daylight saving changes. Store timestamptz (Postgres) or ISO 8601 strings with Z, use timezone-aware datetimes in Python (datetime.now(timezone.utc)), and format in the browser with Intl.DateTimeFormat using the user's timezone. Date-only values (birthdays) should stay dates, not midnight timestamps.
