53 points · by donohoe · 13y ago · 54 comments
Calendar/time stuff is really, really hard. That's not an excuse for Apple in particular, just that the pitfalls are many and varied to the point where even smart people will screw it up.
I imagine one reason it doesn't seem so hard at first glance is because time and the calendar, in our lived experience, is relatively simple.
Actual implementations often look more like this: http://www.epoch-calendar.com/support/getting_iso_week.html
Implementing it as a one-liner would be an interesting code golf exercise.
It is not technically a bug but it real easy to get wrong. Perhaps they should have picked sometimg other than YYYY for week years.
Maybe there's code in there that checks day of week but it's hardcoded to run every day to make the UI simpler.
As others have noted, it'll break during leap seconds where a full second repeats and unix time "conveniently" forgets about it ever existing.
At the same time, the human brain doesn't seem particularly well-suited to breaking down Unix time into meaningful and reliably consistent scales, so I don't see time getting much easier barring some revolutionary timekeeping system.
Yes, you still have to deal with timezones, but I'd much rather be given a UNIX timestamp for a UTC time and then adjust accordingly, rather than deal with all the other problems that come from communicating and converting between various other calendar formats and locales.
And this exchange should occur at the very last step, only when being displayed to the user. For almost any other purposes, there's no reason that two different applications should need to talk to each other using anything but UNIX timestamps. The potentially error-prone conversion should happen in the latest stage possible, because that's the part with the most knowledge of how any error should be corrected.
> At the same time, the human brain doesn't seem particularly well-suited to breaking down Unix time into meaningful scales,
But we're talking about for programming purposes - to a computer, one 64-bit int is as good as any other.
http://appleinsider.com/articles/11/01/01/apple_admits_new_y...
Even the response to the problem is similar. Microsoft says, wait until the 2nd and the problem will resolve itself. Apple says, wait until the 7th and the problem will resolve itself.
[1] http://www.pcworld.com/article/156240/microsoft_zune_failure...
iPhones need timed mute like Shush! on Android [1] - press mute: it asks "how long?"
Going into the cinema? Mute for two hours. Meeting? An hour.
1. https://play.google.com/store/apps/details?id=com.publicobje...
It's simply staggering that this has apparently never occurred to anyone at Apple. The cheapest feature phone in a bubble package at Radio Shack supports silent ringtones -- or at least it did a few years ago -- but with the iPhone, the user has to record or purchase a track with several seconds of silence and create one manually.
I wrote an app that allows you to change the ringtone on someone else's phone (think xmas tunes, valentine songs etc etc). Anyway, one of my users had this issue where his wife is expecting a kid and he always has his phone on silent at work, so I've extended the app so that if he enables a web password, she can log in, turn his phone off silent and then ring him.
Before you say it, no it's not for iPhone but for Android. It's called TonePush Beta. All feedback gratefully received.
Okay maybe not.
So maybe it's using 11 PM yesterday as the trigger instead of 11 PM today.
http://arstechnica.com/gadgets/2012/11/december-conspicuousl...
programming can be a bit less hard if you learn to do it right.