Kyle K
1 min readOct 4, 2023

--

Hello, storing date-time as UTC does not mean you don't care about the timezone, on the contrary, if you particularly care about the timezone you store it separately and with its own granularity. If any row can have a different timezone, then you store it in another column, but the can date-time stay UTC (if you use Unix timestamp, it's also UTC by definition) so you can for instance sort them all without additional conversion.

But it's also an opportunity to store those timezone with an even more meaningful accuracy. If it comes from a power plan, then it's more accurate to get your timestamp / UTC date-time from some "energy_interval" table, but to take the timezone from "power_plant" table.

Recommending UTC storage for dates and times is not encouraging to neglect the timezone. On the contrary, it's about a proper segregation of responsibilities: datetime and timezone are not 1 atomic thing you should piggy-bag together, datetime is a point and timezone is a lens you use to look at this point

--

--

No responses yet