Any of you good people on software dev Mastodon have a good solution to this problem?

For legal reasons, we need to store datetime values in a Postgres DB that will adapt to future political changes in TZ/DST rules. The dates are often several decades into the future. So a TZ for a given day at a given hour must be correct when it arrives. UTC cannot store this info, and UTC is what Postgres stores it seems.

cc @mpejcoch

#Developers #Devs #Postgres #DB #Backend

@veronica @mpejcoch Would storing the date, time in local time, along with timezone as separate columns help?

Depends on how you need to query things to some extent.

@intrbiz We've already figured out a solution. To be fully reversible, we need to save the timestamp in UTC, the time zone identifier, and the original time zone offset used.

Sign in to participate in the conversation
Mastodon

Time for a cuppa... Earl Grey please!