6 ms·
Time Zones Aren’t Offsets – Offsets Aren’t Time Zones
- wang_li 10y agoUh. Eastern, Mountain, Atlantic, etc. are actual official time zones. America/Detroit does not appear to be such.
- sp332 10y agoEastern Standard Time is an offset -5:00, not a time zone. Eastern Daylight Time is a different offset -4:00 that is used in many of the same time zones as EST, at different times of year.
- sb8244 10y agoDevney mentions that she is focusing only on IANA timezones. See a list here https://en.wikipedia.org/wiki/List_of_tz_database_time_zones https://en.wikipedia.org/wiki/List_of_tz_database_time_zones America/Detroit is a valid IANA timezone. Eastern is not. Edit: Etzos has pointed out that US/Eastern is on the list. Thanks for correction.
- Etzos 10y agoYou'll notice that list includes US/Eastern which links to America/New_York as the correct "standard" for that timezone. Edit: Just want to clarify that "Eastern" and others are indeed on that list and everywhere I've needed them have worked in place of the physical location equivalent. The physical locations, however, are the standard for the respective timezones--I am not commenting on the correctness of the GP post.
- sb8244 10y agoThank you, I missed that. I have noted your correction in my comment.
- wang_li 10y agoAh. I missed that while skimming through the page. I was primarily responding to the statement made that "they are also called “time zones” in casual conversation." They are time zones in the official sense of the word. Speaking as if the Olson tz database is authoritative and official reminds me of when some small country cancelled summer time with only a few days notice and our OS vendors were not going to be putting out a patch in time. While explaining the process of downloading the Olson tz database and updating systems manually, a coworker asked who gave them (the country's government) permission to cancel DST. It took longer than it should have for me to come up with an explanation that sovereign countries don't need permission from the Internet or OS vendors to change their laws and regulations. The computers track the government actions, not the other way around.
- zigg 10y agoWhile you're right that countries don't need permission to change their timekeeping, they should be fully informed of the technical trouble they're creating when they make changes.
- kps 10y ago> some small country cancelled summer time with only a few days notice Egypt just did that. - In April, Egypt announced daylight time would start July 7. http://english.ahram.org.eg/NewsContent/1/0/204655/Egypt/0/Daylight-savings-time-in-Egypt-postponed-to--July.aspx http://english.ahram.org.eg/NewsContent/1/0/204655/Egypt/0/D... - On June 30, Egypt decided daylight time would start July 5. http://english.ahram.org.eg/NewsContent/1/64/232199/Egypt/Politics-/Daylight-savings-time-to-start-on--July-Minister.aspx http://english.ahram.org.eg/NewsContent/1/64/232199/Egypt/Po... - On July 4, Egypt decided not to have daylight time. http://english.ahram.org.eg/NewsContent/1/64/232478/Egypt/Politics-/Egypts-cabinet-abolishes-daylight-saving-time.aspx http://english.ahram.org.eg/NewsContent/1/64/232478/Egypt/Po...
- deleted 10y ago[deleted]
- teraflop 10y agoIf it helps, you can think of the IANA time zones as functions from UTC to local time. This is not quite the same as the political definition. For instance, both America/Boise and America/Phoenix are in the "Mountain time zone". But when viewed as functions, they're very different -- one is continuous and the other is not. To add another layer of complexity, the tz database is capable of representing time zones whose definitions are themselves changing over time. If your state government decides to switch from Eastern to Central time next year, you still want to be able to accurately answer questions like "what was the current local time in this location at UTC instant t?".
- zeta0134 10y agoComputerphile did an excellent overview of time zones and all their complexities in the context of programming: https://www.youtube.com/watch?v=-5wpm-gesOY https://www.youtube.com/watch?v=-5wpm-gesOY I was quite surprised by some of the stranger rules out there, especially the regions that chose to skip a day for whatever reason. Timezones are complex! Far, far more complex than simple offsets.
- 1_2__3 10y agoDid the author just collect a bunch of random bits of information from Wikipedia and attempt to construct a thesis around it, or is there a point to this article that I'm missing?
- sb8244 10y agoWhen you select your "timezone" in a web application, you usually get a list of offsets instead. If you live in a town which falls in an offset but the timezone isn't consistent, then your time will not be correct at certain parts of the year. It is important to understand the difference so you can build a time system that works for everyone, not just the majority.
- douche 10y agoI'm increasingly becoming convinced that there is no reasonable way to build a time system that works everywhere. It's ridiculously complicated.
- sb8244 10y agoI think I would agree with you. It's definitely tricky.
- lostlogin 10y agoFond memories of Travian games here. Log into enemy account via a super dodgy sitting arrangement, send a confusing message about the time of an attack and watch chaos unfold as other players in the alliance screw up the offset they were aiming for and leaning early or late. Even when no shenanigans were played there was a 50/50 chance that someone would mess it up.
- Sacho 10y agoI don't think this has been true for a while now. For example, the most common timezone picker I see has multiple timezones listed per offset. Here's some examples: http://www.jqueryscript.net/time-clock/Easy-Timezone-Picker-with-jQuery-Moment-js-Timezones.html http://www.jqueryscript.net/time-clock/Easy-Timezone-Picker-... http://n.exts.ch/resource/post-30342bc1aac8ab98c817edee2b126a6a/win9x_dropdown.gif http://n.exts.ch/resource/post-30342bc1aac8ab98c817edee2b126... http://docs.telerik.com/devtools/aspnet-ajax/controls/scheduler/accessibility-and-internationalization/images/scheduler_timezones.png http://docs.telerik.com/devtools/aspnet-ajax/controls/schedu...
- deleted 10y ago[deleted]
- adamnemecek 10y agoMy mind was blown a while back when I learned that there are timezones with offsets that are not whole hours. E.g. Kathmandu is +05:45.
- Animats 10y agoThe Saudi government was considering running the really big clock (46 meter diameter) in Mecca [1] on local solar time. The goal was to run the entire Islamic world on Mecca time.[2] But it didn't happen. [1] https://en.wikipedia.org/wiki/Abraj_Al_Bait https://en.wikipedia.org/wiki/Abraj_Al_Bait [2] http://www.telegraph.co.uk/news/worldnews/middleeast/saudiarabia/7937123/Giant-Mecca-clock-seeks-to-call-time-on-Greenwich.html http://www.telegraph.co.uk/news/worldnews/middleeast/saudiar...
- thaumasiotes 10y agoAll of China (the size of the US) operates on Beijing (east coast) time.
- davidw 10y agoThey're not even all in "exotic" locations: https://en.wikipedia.org/wiki/Newfoundland_Time_Zone https://en.wikipedia.org/wiki/Newfoundland_Time_Zone
- astrodust 10y agoAnyone who's lived in Canada for any period of time is almost immediate bombarded with this reminder. Newfoundland (eastern-most province) is half an hour off so most television shows must convey this through a mantra like: "Tonight at 6pm (6:30pm in Newfoundland)". https://en.wikipedia.org/wiki/Newfoundland_Time_Zone https://en.wikipedia.org/wiki/Newfoundland_Time_Zone
- deleted 10y ago[deleted]
- Marazan 10y agoHow about that Timezone with offset +13 hours. So much crazyness in the world of Timezones. Or Morroco Timezone which does the DST dance 4 times a year rather than just 2.
- gregmac 10y agoRelated and previously discussed: Falsehoods programmers believe about time and time zones [1] [1] https://news.ycombinator.com/item?id=11515125 https://news.ycombinator.com/item?id=11515125
- fascinated 10y agoI, for one, have enjoyed seeing this piece of content marketing on top of HN, and will be buying this company's products and services. Good to see something other than the Macro up here.
- andrewfromx 10y agoI changed all my clocks awhile ago to UTC 24 hour. My life is 0 to 23 as it should be. An hour is an array index between that range. UTC is the standard. Standards are great. Like headphone jacks. Imagine (john lennon voice) everyone living this way. Stop thinking your 23 must be night time and my 7 must be start of day. They are just numbers. It's 20 right now. What does 20 mean? Nothing, it's just a pointer.
- spacehunt 10y agoFor recording events that happened, sure. For future events (eg. meetings at 10am every Tuesday), unfortunately we still need to deal with timezones...
- andrewfromx 10y agono that kind of thinking is what causes world wars! Everyone can agree on 0 to 23 the whole world over and make that "Tuesday 10am" meeting.
- amptorn 10y agoWhat does "am" mean?
- thaumasiotes 10y agoNo, the idea is that everyone uses UTC. There is no benefit to individual timezones.
- kevin_thibedeau 10y agoThen everyone outside the tropics has to adjust their daily schedule as the seasons change. Measured time is a tool that exists for the convenience of man not computers or their programmers.
- andrewfromx 10y ago
- joshstrange 10y agoHaha, I have this sign [0] hanging in my work area along with a number of other TZ-related quick-reference documents. After getting burned badly by pre-existing code that assumed America/Mexico_City was the same as America/Chicago (As in both were "Central" and had offsets of -6/-5). While they have the same offsets they change between DT/ST 2 weeks apart. I learned of all of this less than 2 weeks out from the change... [0] https://www.dropbox.com/s/kwiddhvbj24th0s/2016-07-06%2015.56.05.jpg?dl=0 https://www.dropbox.com/s/kwiddhvbj24th0s/2016-07-06%2015.56...
- devy 10y agoTo me, one of biggest culprits of DST is also the reason why offsets and timezones aren't in 1:1 relationships. The arbitrary mandates of time changes from all levels of local/state/nation governments had made it a big mess in figuring out local times. Time should be continuous in nature. But it's not when you apply all these manmade rules. Here is the table[1] of most but probably incomplete rules. [1]: https://en.wikipedia.org/wiki/Daylight_saving_time_by_country#Daylight_Saving_Time_rules_as_of_2016 https://en.wikipedia.org/wiki/Daylight_saving_time_by_countr...
- jedrek 10y agoDST is an issue, as is the political selection of time zones. There's a great map[1] that shows how arbitrary time zone shifts are. Even in the EU, the eastern edge of Finland is over an hour east of the center of CET, while western Spain is two hours west of it. That means that during the spring and autumn solstice, even though we have 12 hours of day and 12 hours of night, the sun over western Spain sets three hours after eastern Norway. For Norway it makes sense, most of its people live smack in CET, but for Spain it's a purely political gesture. [1] http://blog.poormansmath.net/how-much-is-time-wrong-around-the-world/ http://blog.poormansmath.net/how-much-is-time-wrong-around-t...
- beeforpork 10y agoI found it amusing to learn about the Australian time zones: Australia is basically divided into three parts, which could be very nicely +8, +9 and +10, except it is +8, +9:30 and +10. OK. Except that in the south, two of the three zones are split and do DST, which the north does not do, so you get +8, +10:30 and +11 in summer in the south (but the north keeps +8, +9:30 and +10). Now, that was my amusement for a couple of years. Then I learned that there is Broken Hill, which follows a time zone different from the surrounding area because of the train track history. And there is Lord Howe Islands, which uses a +0:30 minute DST shift instead of an hour. And then I learned that history also experimented with 20 minute and 15 minute DST shifts, and that double DST (or Hochsommerzeit in Germany) was quite common, too. You can probably go on and on and on as you dig deeper, and at some point, anyone's mind will blow, I guess.
- gumby 10y agoWhy is it amusing? Australian states can be quite large and this allows all of South Australia to share a common time, even though they span two (arbitrary) "time zones". India does the same. Russia tried to do what China does (one TZ) but it is pretty hard -- people like to be awake when the sun is up.
- beeforpork 10y agoSorry for the confusion; I don't find it amusing at all for the size, but for the irregularities.
- Turing_Machine 10y agoAlaska used to have four time zones. The panhandle in Southeast was on Pacific (UTC-8), some portions of eastern Alaska were on Yukon (UTC-9), central Alaska was on Alaska-Hawaii (UTC-10), and western Alaska and the Aleutians were on Bering (UTC-11). Now it's down to 2. Most of Alaska has been placed in the Alaska zone (UTC-9...the former Yukon zone, renamed because Yukon itself (in Canada) moved to Pacific at some point) and the extreme western Aleutians are on Hawaii-Aleutian time (UTC-10). This posed some hardship, since most of the state is at least one hour earlier than its "natural" time (in some cases, two or more) but has the advantage of reducing the time offset between Alaska and the Lower 48. A mitigating factor is that due to the high latitude the sun's position and clock time have only a loose relationship anyway for much of the year.
- JoblessWonder 10y agoAs someone who recently had to implement time zone (offset) preferences in a web app to satisfy a "Daily Requirements" feature... I just wanted to say that I hate time zones with a passion.
- niftich 10y agoIt's so much more pleasant to deal with datetimes and timezones when you have a good API that doesn't muddle and mix concepts for you. The Java 8 time API [1] stands out, which was co-authored by Stephen Colebourne of Joda-Time fame [2]. [1] https://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html https://docs.oracle.com/javase/8/docs/api/java/time/package-... [2] http://www.joda.org/joda-time/ http://www.joda.org/joda-time/
- imkevinxu 10y agoThat linked story about Michigan's -5:32:11 offset is hilarious https://github.com/eggert/tz/blob/master/northamerica#L979 https://github.com/eggert/tz/blob/master/northamerica#L979
- __jal 10y agoThe programming mistakes people make relating to time are legion. I feel like time/date, floating point and crypto are areas where nearly everyone (not just programmers) would hugely benefit by coders only using libraries written by the very few who are actually competent to write them[1]. And anyone who thinks they are qualified to write time related code by virtue of having coexisted with clocks and time definitely should not be writing time related code. [1] Time handling is different than FP and crypto, in that most of the complexity is human-created and policy driven rather than deep math, but for whatever reason people really don't understand that time handling is very complex - it seems to be widespread Dunning-Kruger. So they repeatedly make bad mistakes with very strange-seeming trigger conditions that can't be debugged on demand until someone realizes it is a time related bug.
- kevb 10y agoI had an unusual timezone related bug. I was adding "Night mode" to Nova Launcher, allowing a dark theme to be applied after sunset. To accurately calculate sunrise/sunset the location permission is required, but that's the only thing Nova Launcher needs the permission for, and only Android 6.0+ has runtime (optional) permissions so I didn't want to force the permission on everybody and needed a fallback. I knew that time zones aren't offsets but locations (ish) and for calculating sunrise/sunset they should be close enough. Nova pulls the device's time zone (something like America/Chicago ), maps it to a lat/long, and calculates the sunrise/sunset. It just depends on how accurate the timezone data is. Public beta went fine, but stable release we start getting a small, but concerning, amount of emails from people saying that their icons won't load, or disappear, after the update. We're asking for information trying to find a pattern, but it's across different Android versions and devices. Finally we notice all the carriers are Canadian. Then it gets more specific, it's Winnipeg (turned out it was actually Manitoba, the province Winnipeg is in). First thing I test is setting my device timezone to America/Winnipeg, but everything works fine for me. We're getting some more device information from the reporters, and their timezone isn't America/Winnipeg. but America/Resolute. That must be close to Winnipeg right? https://goo.gl/maps/E5vj5nHfJgu https://goo.gl/maps/E5vj5nHfJgu Notice how far north it is. https://www.timeanddate.com/astronomy/canada/resolute https://www.timeanddate.com/astronomy/canada/resolute And the sunrise/sunset times, or lack thereof... I actually anticipated this, and there was some code to just use hard coded times for cities too far north to have a sane sunrise/sunset. However either that code broke later, or it only worked with GPS coordinates, and I assumed all the timezones were safe. I don't know why carriers in Winnipeg report the timezone as Resolute, but the fix came in two stages. 1) Properly handle locations that don't have sane sunrise/sunset times. and 2) Treat America/Resolute as America/Winnipeg