Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Another fun fact about timezones: if the government abolishes DST one year, and then moves some timezones an hour the next year, it creates a wild mess. Especially when you're building an Android app. Especially when it's the early 2010s so the timezone database is built into the system image but most devices that run your app don't receive system updates at all.

Instead of picking the timezone with the correct offset and no DST, many people would adjust the time itself so the wrong timezone and the wrong unixtime cancel each other out so the clock "looks right". Not fun when you're doing math with timestamps, some of which are local and some come from the server.



This makes me wonder: Should NTP servers broadcast the tz database...? (And should the tz database support a stable but turing-complete scripting/bytecode language?)


That sounds like the beginning of a story that ends with an RCE.


Hey, if OpenType fonts get to do it, why shouldn't timezones? :)


I worked with a group of people once who just didn't care about timezones. All (ok, most) clocks were set to local time, but with some random timezone, about half of the time it was GMT, and 2/3 of the remainder were our actual timezone, but the rest were totally random. I had to write a "figure out what the time actually is" routine in my code because it was such a pervasive problem.


I ended up doing kinda the same. Our API already had a method to retrieve the current unixtime on the server, which I used, together with the user-set timezone, to figure out the UTC offset that the user actually meant to set by adjusting their clock.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: