8 ms·
It's even harder. Is the time the user entered actually an always-local time? As in, if I set my alarm for 08:00, I'd expect it to wake me up 08:00 local regar
by magicalhippo 4y ago
It's even harder. Is the time the user entered actually an always-local time?
As in, if I set my alarm for 08:00, I'd expect it to wake me up 08:00 local regardless if I'm in Oslo or I've traveled to say New York.
However if I make a calendar event things are less clear cut. For meetings and such it makes sense that the time is global time (hence stored in UTC), but for tasks it can be be either or, depending.
- sdfghswe 4y agoI really like what google calendar does, which is to allow you to display both.
- comicjk 4y agoI was baffled when I first entered my schedule for a conference into Google Maps, only to find when I flew across the country that all the times were wrong. I understand that it's a reasonable choice to use the local time zone at event creation, but it sure wasn't what I expected (I vaguely thought it would be like your alarm clock example, where it would move with the local time).
- arnsholt 4y agoI once made a flight by the slimmest of margins possible (the gate crew stopped closing the check in because they saw me sprinting through the terminal hall), because of this and only one hour difference between where I started from and where I went.
- ehvatum 4y agoI mean obviously wherever a date time entry can be found, there should be a TZ drop-down and a DST checkbox. lusers who don’t know what those things are will learn soon enough. I really mean it. The ambiguity is a problem.
- paulddraper 4y agoI've done the same. Google did 100% the correct thing, but it goes to show that this is just an inherently tricky thing not limited to whether you are writing code.
- maicro 4y agoThank you for the examples - now I know to not try to make and publish an alarm clock or calendar app/site/feature...
- cameronh90 4y agoWhat happens exactly if you set your alarm for 1:30AM on DST changes. Does it go off twice in Autumn and skip altogether in Spring?
- Uehreka 4y agoThe whole DST time change is predicated on the fact that almost nobody sets alarms (or does anything time-sensitive) at 130AM local time. So yeah, if you do that, that’ll happen.
- tshaddox 4y agoIs that actually true though? Does, say, an iPhone actually fire the alarm both times the clock flips to 1:30am? I tried Googling it but I could only find info about missing alarms entirely when springing forward. I also found some info about how cron works but even then the answer was “it depends which version of cron you’re using.”
- ska 4y agoYou don't even need timezones or DST to run into issues along these lines. Let's say you have have a repeating 7am alarm on your phone. What should happen if you want to set it to 8am for one day? I mean, without walking you through a dialog that looks like: do you mean today 8, or tomorrow 8?
- tshaddox 4y agoThis is the part that isn’t even technically hard per se. It’s just hard because there’s literally no way to know what the computer should do because there’s no way to know what a human would even expect. In many cases reasonable assumptions can be made, e.g. a calendar event for two people in different time zones to meet on a video call almost certainly needs to be scheduled for a proper time (or likely UTC, which is close enough since if you can ignore leap seconds). Although even then I wonder what the two attendees would expect if, between the scheduling of the event and the event itself, both of their local time zones changed their DST rules such that their UTC offset changed by +1 hours. If only one time zone changed its UTC offset we might assume that the previously agreed upon UTC time would hold, but it’s hard to say what the humans would expect if both of their time zones shifted the same way.
- stavros 4y agoI've been in this situation, and what people expect are that the "main office" time holds, even for remote teams that should know better. Then again, you don't want all your meetings changing by an hour half the year to avoid a one-week discrepancy.
- tshaddox 4y agoIf there’s a clear “main office” that’s probably a reasonable assumption, and it’s probably a reasonable feature for calendars to explicitly allow scheduling an event for a specific time zone (instead of converting every datetime to UTC or similar before storing it, which is the usual recommendation among programmers).
- disgruntledphd2 4y agoI'm pretty sure that both MS and Google default to the time of whoever set up the meeting.
- johnwalkr 4y agoI think it's fixed now, but DB (german transit company) used to always use your local time in its app, making it incredibly confusing to book tickets or even check on tickets you already have. I planned a trip from Japan and the train times showing up were something like 2:30 in the morning. Another bad example is using Windows bootcamp on a mac. Windows writes local time to the RTC and MacOS writes universal time, so when switching between MacOS and Windows, it's always wrong at first.
- lloeki 4y ago> Windows writes local time I seem to recall there's a registry key to control that and have it store UTC to the RTC edit: found that one https://superuser.com/questions/975717/does-windows-10-support-utc-as-bios-time#975764 https://superuser.com/questions/975717/does-windows-10-suppo...
- somat 4y agoI do this, If you have a unix install on the same host, It really helps keep a sane time config. there are ways to do it the other way around. sysctl kern.utc_offset on openbsd. But the unix way feels better to me, so I change windows.
- wolrah 4y ago> But the unix way feels better to me, so I change windows. I'm with you as well. Sometimes you don't have a choice when dual-booting, MS-DOS only wants to work in local time while on the opposite end of the spectrum MacOS only wants to work in UTC, but if I have the choice I'm going to change Windows to use UTC.
- johnwalkr 4y agoGood to know, thanks!
- gst 4y agoEven worse with transit in Vienna/Austria where if you buy tickets in advance for a specific day or date range they seem to take your local time into account if those tickets are bought while in another timezone. That's for tickets where time shouldn't even matter because they are for full days (from midnight to midnight). If you're in Pacific time and you buy the ticket for a date in the future (let's say June 1st) before 3pm your local time everything works fine. But if you buy the same ticket for June 1st after 3pm Pacific local time (which is already the next day in Vienna) the ticket that you're buying isn't for June 1st but actually for June 2nd (only visible once you receive the confirmation). So apparently they're somehow translating between timezones for the displayed dates, although that doesn't make sense: If I buy a ticket for June 1st on Vienna public transport I don't care what my local time is. Even if I'm in California while buying that ticket I still want it to be valid on June 1st instead of June 2nd.
- bentcorner 4y ago> For meetings and such it makes sense that the time is global time (hence stored in UTC) I think this is tricky too - if you have a 9AM meeting, if your time zone switches, should the time of your meeting change too? Most of the time, no, but if you have a meeting with other people in far away time zones, maybe you don't want it to change.
- tshaddox 4y agoDoesn’t “meeting” imply multiple people, and the only time you’d need to worry about time zone issues is when those multiple people are not all in the same time zone?
- dylan604 4y agoSome people using "meeting" to block off time for the sole purpose of being unavailable for someone else to schedule you in a meeting.
- Dylan16807 4y agoThat's hard enough for a calendar program to figure out, but also it can also be affected by whether other meetings involved multiple time zones, especially when something is recurring.