Timezone Storage Debate

Discussions center on best practices for storing dates and times in software, debating UTC-only storage versus preserving local timezone information due to issues like DST changes and future events.

➡️ Stable 0.5x Databases
4,759
Comments
20
Years Active
5
Top Authors
#4876
Topic ID

Activity Over Time

2007
2
2008
2
2009
25
2010
12
2011
130
2012
132
2013
150
2014
105
2015
203
2016
241
2017
212
2018
242
2019
342
2020
278
2021
468
2022
467
2023
672
2024
490
2025
562
2026
24

Keywords

e.g US CUT TimeZone OK TUC MyCity IST TSDB AM utc timezone dst local timestamps timestamp storing event time zone zone

Sample Comments

lijok Feb 18, 2024 View on HN

Unfortunately timezones have the nasty ability to change.See: https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a...

Jaruzel Mar 19, 2020 View on HN

One wonders, why don't they just use UTC ?

t-3 Oct 19, 2021 View on HN

Can't you just use UTC? Isn't that basically exactly what it is?

hajhatten Sep 4, 2021 View on HN

Why not just explicitly use UTC everywhere?

0x0 Mar 13, 2022 View on HN

Doesn't help you much if you stored an UTC for a future meeting, then the TZ rules change, and then you show up an hour late.

growse May 30, 2020 View on HN

This isn't true.For example: If a user schedules an event to happen at 15:35 on July 29th 2021 IST, you cannot know with certainty what the equivalent UTC value is. You know what it would be assuming the relationship between IST and UTC stays the same between now and next year. If India suddenly decides to implement some sort of DST, or make any other changes to the definition to IST, the UTC value you stored is now wrong.Timezones are political, but they're also ho

bnr Dec 21, 2012 View on HN

What's the use case for storing a time with timezone instead of just storing the UTC value?

inferiorhuman Mar 26, 2023 View on HN

Maybe you aren't on top of keeping your timezone database up to date, maybe you have to deal with dates spanning 2005, maybe Ontario will finally abolish DST. Using UTC simplifies time handling with very little downside.

nicoburns Jun 29, 2021 View on HN

This falls down if the timezones themselves change. e.g. if DST was planned, but was then cancelled. You really want to store the original time with timezone as well as UTC.

unixbane Mar 16, 2022 View on HN

yes, this is a very big problem for devs who practice tutorial oriented programming and store and transmit local times.