3 ms·
Not nearly as cursed as two parent comments, but there was a widespread problem in my very popular Android app. The relative date formatting function worked inc
by grishka 5y ago
Not nearly as cursed as two parent comments, but there was a widespread problem in my very popular Android app. The relative date formatting function worked incorrectly for many users, it was off by one hour. It turns out that when Russia (where most of our users were) had abolished DST, and then changed timezones a couple of times, people got really confused. Since Android's timezone data is part of the system, it was basically set in stone. Most of the users didn't choose the timezone with the correct offset, but instead set their time an hour forward so the incorrect timezone and incorrect unixtime cancel each other out for a "correct" displayed time.
I ended up getting the known correct unixtime from the server to try to guess which timezone offset the user actually meant and correcting the result of System.currentTimeMillis() and my formatting for that.