Live data from Hacker News

Australia/Lord_Howe is the weirdest timezone

ssoready.com

91–100 of 466 posts

Re: Australia/Lord_Howe is the weirdest timezone

#91

Earlier this year I had to write a function to find the current local time given a US address. The naive way to do so would be via a static mapping of state to time zone but there are a few edge cases that preclude doing this; in the interest of cost and speed relative to this specific application I spent a few dollars on a CSV that maps every US ZIP code to UTC offset and whether DST is followed (among other data).…

> The naive way to do so would be via a static mapping of state to time zone but there are a few edge cases that preclude doing this

More than a few, state is really the wrong resolution here, US timezones follow counties and native reservations borders.

ZIP codes should probably be good enough but I'd be careful too. If your volume of addresses isn't too crazy, the robust way is to reverse geocode them and use a library that gets you the IANA identifier from timezone shapes.

https://github.com/RomanIakovlev/timeshape is maintained by a former coworker who could open source some of the work we did internally.

Re: Australia/Lord_Howe is the weirdest timezone

#92
post #80

The time zone in Palestine is a bit weird as well: https://en.wikipedia.org/wiki/Time_in_the_State_of_Palestine They have DST, but it's not on fixed dates, the government just announces each year when it's going to start and end. Sometimes with less that a week's notice, which must cause all kinds of interesting problems for people.

Without getting deep into politics I don't understand why they would prioritize spending effort on DST at all, seems like there are plenty of other concerns.

If your life is dominated by an us vs them dynamic small demonstrations of difference become hugely important.

In a similar vein different people in Xinjiang in China observe entirely different timezones - Han Chinese observe Beijing time (because China is insane and uses one timezone despite spanning 5), while Uyghurs observe a local time 2 hours behind.

It’s a small show of resistance, which is sometimes all a people have if they have limited control of their own affairs.

Re: Australia/Lord_Howe is the weirdest timezone

#93
post #80

The time zone in Palestine is a bit weird as well: https://en.wikipedia.org/wiki/Time_in_the_State_of_Palestine They have DST, but it's not on fixed dates, the government just announces each year when it's going to start and end. Sometimes with less that a week's notice, which must cause all kinds of interesting problems for people.

Not sure if true today, but used to be the case in Brazil too. Once almost missed a flight because of that.

Re: Australia/Lord_Howe is the weirdest timezone

#94
post #80

The time zone in Palestine is a bit weird as well: https://en.wikipedia.org/wiki/Time_in_the_State_of_Palestine They have DST, but it's not on fixed dates, the government just announces each year when it's going to start and end. Sometimes with less that a week's notice, which must cause all kinds of interesting problems for people.

Without getting deep into politics I don't understand why they would prioritize spending effort on DST at all, seems like there are plenty of other concerns.

Again, without wanting to get too political, I think it's essentially bikeshedding. The Palestinian National Authority is riven with factional conflicts and has very limited state capacity. That almost inevitably leads to a lot of bickering over largely irrelevant decisions as a symbolic but hollow demonstration of political authority. The ability to make the decision takes on an importance completely out of proportion with the actual significance of the decision.

Re: Australia/Lord_Howe is the weirdest timezone

#95
post #68

I’ve found the best way to deal with TZ conversions, is to use UTC as a common fulcrum. I convert the target TZ to UTC, using my local utility, then use my local TZ utility to convert from UTC to local. But I write iOS software, so I have very solid local tools at hand. It might be more problematic, on, say, a webserver. On a related note, I wrote this utility[0], some time ago. It uses the TZ map from the TZ Boundar…

UTC is generally a good idea for storing, but there are still some ways to have that bite you. If a user enters a local date time for a future event in a particular time zone, converting that to UTC could result in incorrect behavior if the timezone definition changes. It depends on if the user meant that UTC time or if they meant the local time.

That's why I do it at the time the query is made. I don't ever store UTC.

Re: Australia/Lord_Howe is the weirdest timezone

#96

Nah, the weirdest time zone is Africa/Addis_Ababa, which nobody in Ethiopia follows. Instead the locals offset the time by 6 hours. So the AM cycle starts at dawn (i.e. 6am), and the PM cycle starts at dusk (i.e. 6pm). https://en.wikipedia.org/wiki/Time_in_Ethiopia

Ethiopian time keeping is peculiar all over.

https://en.wikipedia.org/wiki/Ethiopian_calendar

The Ethiopian calendar has twelve months, all thirty days long, and five or six epagomenal days, which form a thirteenth month.

Re: Australia/Lord_Howe is the weirdest timezone

#97
Does anyone understand what was meant by "This is because almost every standard (except ISO8601, whatever) is just a file, and you can read it." Initially I thought it was because the PDF of ISO-8601 is not a file commonly distributed with operating system. But that's not unique to ISO8601, you won't find IEEE 1588-2019 or NMEA 0183 v4.11 on your computer either. For ~20$ I think I can buy a PDF of the standard from ISO. Is there something special about ISO8601 that is not contained in the standard?

Re: Australia/Lord_Howe is the weirdest timezone

#98
post #80

The time zone in Palestine is a bit weird as well: https://en.wikipedia.org/wiki/Time_in_the_State_of_Palestine They have DST, but it's not on fixed dates, the government just announces each year when it's going to start and end. Sometimes with less that a week's notice, which must cause all kinds of interesting problems for people.

Without getting deep into politics I don't understand why they would prioritize spending effort on DST at all, seems like there are plenty of other concerns.

I don't see why announcing DST would be a big effort. And it saves on electricity costs.

Re: Australia/Lord_Howe is the weirdest timezone

#99
The most interesting timezone I ever encountered is Europe/Moscow on and around January 1, 1900. If you decide to use that date as a zero date in your code (for example, to handle the transition from two digits per year), you will be in a lot of pain: the offset was +02:30:17. Yes, with 17 seconds! Demo: https://go.dev/play/p/lq36Plr1sIL

Re: Australia/Lord_Howe is the weirdest timezone

#100
post #68

I’ve found the best way to deal with TZ conversions, is to use UTC as a common fulcrum. I convert the target TZ to UTC, using my local utility, then use my local TZ utility to convert from UTC to local. But I write iOS software, so I have very solid local tools at hand. It might be more problematic, on, say, a webserver. On a related note, I wrote this utility[0], some time ago. It uses the TZ map from the TZ Boundar…

UTC is generally a good idea for storing, but there are still some ways to have that bite you. If a user enters a local date time for a future event in a particular time zone, converting that to UTC could result in incorrect behavior if the timezone definition changes. It depends on if the user meant that UTC time or if they meant the local time.

> if the timezone definition changes

Or if DST kicks in/out. No need to have the definitions change.

Post reply on HN