Live data from Hacker News

Timezone Bullshit

blog.wesleyac.com

131–140 of 334 posts

Re: Timezone Bullshit

#131
post #102
post #71

When I use the "full" timezone name like "America/New_York", how does libc resolve the ambiguity during the extra hour of the transition from daylight saving time to standard time?

Tzdb has the date and time that location starts/reverts DST. It is updated regularly to keep up with regions changing the time zones. It happens frequently than many of us like.

I'm not sure I follow (and this week, timezones and time handling are really important for my job, so I really want to understand)!

If a user provides a time of 11/7/2021 1:50 AM America/New_York, how does the library determine if it's a -5 or -4 offset given that's when daylight savings time ends? I believe that's the ambiguity GP is referring to.

I'm trying to align time across a few systems I work with. One provides a GMT time with an offset (clean and useful), another system reports timezones and local time, and yet another system has no idea when it moves between time zones, but reports time based on a single timezone consistently.

Not dealing with multiple timezones in the past, it reminds me of Tom Scott's video on handling time and timezones, summarized at the end as roughly "Go find someone who built a library for handling times, thank them profusely, use their open source code, give them credit, and never worry about it again."

https://youtu.be/-5wpm-gesOY

Re: Timezone Bullshit

#132
post #108

Earlier quoted context omitted.

I don’t think anyone other than programmers thinks DST is much of an inconvenience. The clock changes twice a year, big deal. That’s infinitely less complicated than asking your boss if you can start earlier, which means the store at the subway station will need to be open an hour earlier (since its business comes from commuters), which means restaurants will need to be open earlier to address the lunch crowd, which…

In all fairness, people like parents with young children, pets, etc. find time changes disruptive. That said, there are good reasons to shift schedules in mid latitudes and daylight saving time is a good way to do that if you don't want 4am sunrises in the summer or heading out in the pitch black in the winter. The reality is that if you don't do daylight savings, you're not going to have a collective switch in sched…

If they find time changes disruptive, changing schedules instead of time is going to be equally disruptive.

Re: Timezone Bullshit

#133
post #62

Earlier quoted context omitted.

What do you have to implement?

The EU is currently one timezone for most of its area, the whole continent excluding Portugal (edit: and Finland, Greece, Baltic states) has the same timezone. But actually it should be 3 or 4 timezones if you want to be close to solar time. Also, there are people who would prefer having solar zone time +1 (so e.g. UTC+2 in Germany instead of UTC+1). The EU decided to chicken out and let the members decide for themse…

IE use DST also fyi.

> The EU decided to chicken out and let the members decide for themselves

There are reasons the EU doesn't just enforce timeZones across its members.. So this is a 'strange' comment that bothered me.

Re: Timezone Bullshit

#134
post #120

Earlier quoted context omitted.

Arizona

Do Arizona banks and post offices and stuff really change their hours in different seasons?

Nope. There really isn't much reason to. The winters are mild, and Arizona is far enough south that there's still a good amount of daylight in the afternoons, at least compared to the northern parts of the US.

Re: Timezone Bullshit

#135
post #9

> There are actually two timezones that are canonically named "CST", and they're 14 hours apart! Yup. If you say CST do you mean China Standard Time or Central Standard Time? The answer will depend on where you live in the world. There are others that share the same abbreviation as well. But CST is the one that constantly causes trouble in daily life. Just say no.

I find using the Olson DB names works in real life too--everybody understands "9AM Chicago" vs. "9AM Shanghai". Major international city names have fewer hash collisions than TZ abbreviations.

Re: Timezone Bullshit

#136
post #120

Earlier quoted context omitted.

Do Arizona banks and post offices and stuff really change their hours in different seasons?

Nope. There really isn't much reason to. The winters are mild, and Arizona is far enough south that there's still a good amount of daylight in the afternoons, at least compared to the northern parts of the US.

I suspect that at least some of disconnect over DST is between people living at 40-50 degrees latitude who have short winter days and those living further south.

Re: Timezone Bullshit

#137
post #108

Earlier quoted context omitted.

In all fairness, people like parents with young children, pets, etc. find time changes disruptive. That said, there are good reasons to shift schedules in mid latitudes and daylight saving time is a good way to do that if you don't want 4am sunrises in the summer or heading out in the pitch black in the winter. The reality is that if you don't do daylight savings, you're not going to have a collective switch in sched…

What's the problem with 4am sunrises?

Because most people would prefer the 4am-5am hour of sun in the evening after work.

Re: Timezone Bullshit

#138
post #47

Earlier quoted context omitted.

On the topic of DST... can you explain why some countries use DST? Anytime I look for the reasoning of it, it says that DST helps "make better use of daytime" but how? The earth isn't gonna say "Damn! These people changed their clocks. I better change by rotation and give them more sun time." Whether you have DST or not, you still have the same amount of time with sunlight in a day.

Golf courses. Well, okay, this is my wonderful father's half serious answer that I love to retell. The basic idea is that it's easier to convince everyone that is actually 5:00pm and time to leave work than it is to convince just your boss that you want to start work an hour earlier and leave and hour earlier. This problem is then applied to politicians and other powerful people, who want to go golfing after work. If…

>So therefore, we change all the clocks so that powerful rich people can go golfing.

>No other group of people sees any benefits to DST.

Ah yes, because only powerful rich people would benefit from extra time in the evening to do outdoor activities.

Re: Timezone Bullshit

#139
post #17

The problem highlighted here causes one of the few gripes I have with PostgreSQL, and its logging capabilities in particular: It seems to only support logging time in one single format, which does contain a timezone identifier - but using the potentially ambiguous shorthand name. A few moons ago, that led me down a whole new rabbit hole of its own that is Golang's time zone parsing capabilities ( https://github.com/g…

I'd say the moral is that server side should always be in UTC.

Unless sub-second accuracy is required, I'd be in favour of UT1. It doesn't use SI seconds (while TAI and UTC do), but it has the advantage that a day has exactly 86400 seconds, so you don't ever have to deal with "23:59:60" timestamps.

Summary:

UT1 - noon is when the sun is above you, day has 86400 seconds (not SI seconds)

TAI - noon drifts away from when the sun is above you, day has 86400 SI seconds

UTC - noon is when the sun is above you (+/- 1 second), day has 86400+/-1 SI seconds

Difference UT1-TAI: continuously diverging

Difference UT1-UTC: continuously diverging up to less than +/-1 second, then discretely jumps back when it gets too big (leap seconds)

Difference TAI-UTC: increasing in discrete increments of +/-1 full second (leap seconds)

Re: Timezone Bullshit

#140
post #132
post #108

Earlier quoted context omitted.

In all fairness, people like parents with young children, pets, etc. find time changes disruptive. That said, there are good reasons to shift schedules in mid latitudes and daylight saving time is a good way to do that if you don't want 4am sunrises in the summer or heading out in the pitch black in the winter. The reality is that if you don't do daylight savings, you're not going to have a collective switch in sched…

If they find time changes disruptive, changing schedules instead of time is going to be equally disruptive.

Sure. My assumption is that absent formal time changes, schedules won't change and people will just live with what, for many, is sub-optimal schedules with respect to sunlight.
Post reply on HN