8 ms·
Before clicking the link and knowing absolutely nothing about what project this even is, I knew from the headline that it would be a timezone or DST issue. I'v
by jakejake 12y ago
Before clicking the link and knowing absolutely nothing about what project this even is, I knew from the headline that it would be a timezone or DST issue. I've had the displeasure of dealing with a lot of TZ offset issues in a time-critical app. They are a always a joy to discover, fix and test.
- deathanatos 12y agoI was also thinking this would be related to DST. The "tricky" bit about Australia is that DST is "backwards", at least compared to those of us in the northern hemisphere. Because the seasons are reversed from those north of the equator, DST is also likewise reversed. They spring forward in October, and fall back in April. It all should make sense when you think about it. (Longer days are still in the summer, and thus DST is still in the summer.) This is of course not unique to Australia. (I think they just happen to crop up probabilistically by having a high population using technology, and are south of the equator.) The cool bit, at least to me, is that the mnemonic "spring forward" still works. Likely, this is only cool to me because the whole thing is unusual. The other odd bit is that some TZs sit on the "wrong" side of the international date line, and thus get interesting offsets such as +13 or +14h from UTC. I think there's some that are -13h too, so the total "length" of day (that is, how long you could remain on a calendar date) is >48h. Thus, at any given time, people in their local time are in as many as three different calendar dates. There's also a few TZs with half-hour offsets. (e.g., they're something like 4.5 hours off UTC.) There's a 3-hour TZ jump at one point on China's border, I think, because all of China is on a single timezone, and the nation is quite wide, east-to-west. We've not even gotten to leap seconds, or that 2100 won't be a leap year. And governments regularly muck with this stuff. The set of timezones and their offsets and DST preferences are constantly changing.
- vacri 12y agoThere's even a silly bit of Australia that has a TZ on a 45-minute boundary (UTC+8:45). Eucla is a tiny place in the middle of nowhere, population 86 in the town, though I don't know how many others might be in that TZ. http://en.wikipedia.org/wiki/Eucla,_Western_Australia#Time_zone http://en.wikipedia.org/wiki/Eucla,_Western_Australia#Time_z...
- jacques_chester 12y agoThere's also the more well-known Central timezone, which aligns on a 30-minute boundary.
- apaprocki 12y agoNepal is the canonical :45 offset timezone example (UTC+5:45, ~28 million people).
- mlakewood 12y agoI think the Sillier one is Broken Hill. That although its in NSW is on the SA Timezone.
- oliyoung 12y agoWell that makes sense in the real-world; Broken Hill gets South Australian television and radio and is much closer to Adelaide than Sydney (500km to 1200km), it makes sense to be on ACST not AEST
- sytringy05 12y agoKununurra have the opposite problem - they are on AWST but are only about 400 kms from Darwin. So the sun comes up at 4am and sets at 4pm.
- mambodog 12y agoBorder Village, a roadhouse on the other side of the WA/SA border, also observes Central Western Time Zone. However, the next stop on the Eyre Highway does not.
- Bockit 12y agoIf I recall correctly from the last time I had to deal with this, it's the first 3 towns on the Eyre highway in WA coming from the SA border. This[1] suggests there are actually 4. [1]: http://www.postcodes-australia.com/timezones http://www.postcodes-australia.com/timezones
- apaprocki 12y agoWhen speaking about general false assumptions about timezones, this article tries to capture as many as possible: http://infiniteundo.com/post/25509354022/more-falsehoods-programmers-believe-about-time http://infiniteundo.com/post/25509354022/more-falsehoods-pro...
- deathanatos 12y agoI have mixed feelings about that article. To get anything done, I feel like the general programmer[1] is allowed to assume, at a bare minimum, a Proleptic Gregorian calendar. Anything else just makes handling early (pre-Gregorian) dates madness. (Various geographical locations adopted the calendar at different times, so you end up needing to know where you are to compute the "local" date. Even further back in history the rules get even more odd, and unknown. [2], if I read it correctly, includes a table of when scholars _think_ people inserted leap years.) Once you go with "Proleptic Gregorian calendar", I think points such as > Months have either 28, 29, 30, or 31 days. …are actually always true. Of course, two bullets down is, > There is only one calendar system in use at one time. Which is essentially what we're using as axiom here. It's true because we've defined it as such. (Cheating, I admit, but if you're building the next great mobile app, do you care?) I do wish that site included fold-out sections to de-mystify some of the points. > Non leap years will never contain a leap day. Your definition of leap year isn't "year with a leap day"? > Unix time is the number of seconds since Jan 1st 1970. > Unix time […] is […] defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970, not counting leap seconds.[3] Again I wish for pop-out explanations, because I'm left to wonder whether POSIX's lack of leap seconds is what the author is hinting at. I'm bored though, so perhaps I should write a gist showing which of these I believe to hold (and why) and which do not (and why). [1]: I think anyone breaking this rule would know that their area of interest requires them to break it, and thus know that they need attention. [2]: https://en.wikipedia.org/wiki/Julian_calendar#Leap_year_error https://en.wikipedia.org/wiki/Julian_calendar#Leap_year_erro... [3]: https://en.wikipedia.org/wiki/Unix_time https://en.wikipedia.org/wiki/Unix_time
- apaprocki 12y agoAgree with everything you've said, but keep in mind non-Proleptic can still be found. Java splits on 15 Oct 1582 by default: https://docs.oracle.com/javase/7/docs/api/java/util/GregorianCalendar.html#setGregorianChange(java.util.Date) https://docs.oracle.com/javase/7/docs/api/java/util/Gregoria...
- cle 12y agoBrazil is another fun one that has caused my team's systems to blow up: since their DST transition occurs at midnight, there is no midnight on the DST transition day.
- apaprocki 12y agoBrazil is the most populous, which is why you've blown up there. They are actually one of a group of ten locales that transition at midnight. They have the dubious distinction of making the JS Date object revert back to the previous day if you create a Date with the transition day due to the constructor defaulting to midnight if not specified. (e.g. new Date(2013, 9, 19) in Brazil) The rest of the locales are much smaller and less likely to have customers you will break: Brazil, Chile, Paraguay, Cuba, Greenland, Iran, Lebanon, Syria, West Bank, Gaza Strip.
- oliyoung 12y agoAs a dev living in one of those half-hour offsets (ACST +9.5 Adelaide, South Australia) i think the only thing it's changed is our awareness of timezone issues, although there's discussion about moving us into AEST or back to AWST which … well … will be painful
- IndianAstronaut 12y agoI am currently working on an application which just uses offset numbers to tell how far away from Greenwich time the zone is. No daylight savings time offset, no south of the equator, etc. Just a hard coded number for each client.
- rodgerd 12y agoNot as much of a joy as when an upstream dev is snottily reverting fixes for a commercially-supported open source product because they refuse to believe in the TZ the customer is in exists.