Menu

1 / 2

Save the moment in UTC, save the place by name: a beginner's guide to dates and timezones

DEV Community: postgres·Payyavula Balanagaraju·9 days ago
#GJTmyfTx
#devtopostgresql#devto#dev#time#moment
Reading 0:00
15s threshold

If your app shows a date or a time to people in more than one place, this guide is for you. You don't need to

know anything about timezones to read it. By the end you'll know the three rules most teams follow, why they

work, and the one case where they are not enough.

I learned all of this the hard way, so let me start there.

How I learned this

When we started, we saved times the simple way: the local time someone typed, with no timezone attached.

For example 2026-12-05 10:00 .

It looked fine. Then it broke quietly:

Courses closed an hour early, or an hour late.

Early-bird prices ended at the wrong moment.

A page showed a different time from the one that was saved.

The cause was the same every time. 2026-12-05 10:00 is not a moment. It's 10:00 somewhere . Without the

"where", every server, browser and job read it in its own timezone, and they didn't agree.

So I read the official sources, asked a lot of questions, and we changed how we store time.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.