This is why I left computer science research. I realized I was working on things that only made sense inside the machine.
Europe/London will be either be left alone for historical purposes, or aliased to its successor for backwards compatibility.
See Type: Link and Source file: backward:
* https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
It could have been Country/City or Region/Country but it's Continent/City instead.
Continents or regions of the world don't change fast or due to politics (not often) and cities aren't renamed or disapear that often, so this scheme is probably a lot more stable than any that uses political entities. (Think about countries that split or rename or become occupied, the locations of cities like Sevastopol (occupation), or Juba (Sudan/South Sudan split) or Jerusalem (every controversy).)
Or what if it's split into two cities, which half were you talking about? This has famously happened with Berlin.
But I do love the `date` utility, which allows alphanumeric time zone abbreviations pretty well.
https://en.m.wikipedia.org/wiki/Tz_database
Even this is not enough for some edge cases like “I shall take my supper every day at 6pm, Jeeves” but one can always find exceptions to anything.
The suggestion above is to have the zone in the timestamp. ISO-8601 and RFC-3339 put the offset in the timestamp.
Zone and offset are different concepts: the up-thread comment's poster's example of Europe/London is one zone, that currently has two offsets, depending on time of year.
The up-thread comment includes a very practical example that any app dealing with something like an "appointment" would have to reckon with.
Including fixed UTC offsets was a massive mistake and it should have never happened. Anything except named timezones is useless.
Otherwise, I'm also always left wondering whether they really meant CET or actually CEST, calculating what the current offset of CET is, double-checking whether there's some other CET that I might be confusing things with (China Eastern Standard Time?) etc.
It is only scheduling future events where they fall down. Calendars and scheduling are demanding applications.
For example, instead of London, suppose you wanted to meet in Glasgow, Scotland, on July 1st 2030, at 6pm local time.
Currently, Glasgow in is timezone Europe/London.
However, it is not unimaginable that in that time, Scotland could hold another referendum on independence and either join Central European Time, or create Scottish Standard Time.
The problem is there is no difference between local time and "offset from UTC", right?
The difference is between applying the UTC offset for a future event using present rules. What we are saying is you should not do that because the rules can change.
I ask you today that we meet at 3PM on January 24th in 2026, at the train station in Berlin.
In my paper calendar book for I mark the date January 24th 2026 with the following note: “meet jvanderbot at 3PM at the train station in Berlin”.
I carry this book with me for the next few years.
Meanwhile, you decide to be modern so you store a note about the meeting in a database. In doing so, you convert the information into a UTC offset for that future time. But you are using current rules for today, which may change.
And then when the day arrives, there has been political changes in the meantime that made it so that the utc offset is different.
Because you converted to utc offset ahead of time, your representation of the time no longer maps to “3 PM” but instead to let’s say “4 PM”.
I show up at 3 PM local time, as we had agreed. But you are nowhere to be seen because in your digital calendar the meeting appears to be for “4 PM”.
This is what we mean when we are talking about the problem with converting a local time to a UTC offset a long time ahead.
https://www.972mag.com/the-worlds-only-ethnic-time-zone/
If there's one thing I've learned about time keeping, it's that whenever you think you've got it all figured out, there's always one more corner case.
> specify a meeting in London, on July 1st 2030, at 6pm local time - no matter what happens to UK timezones between now and then
GPS coordinates + local date and local time will preserve “a meeting in London, on July 1st 2030, at 6pm local time” in the desired way
That’s the point. Normal people think about time based on their local time. If they agree to meet someone at 3pm on a day in the future, that normally means turning up on that day when a local clock on that day reads 3pm. If local time changes offset from UTC, then the meeting implicitly also changes.
I’ve personally yet to meet someone that reschedules all their appointments every time day light saving (or the inverse) rolls around. Just make sure their appointment times in UTC don’t change.
Then when the meeting time is approaching, the software can figure out what time zone (and UTC offset) applies, after taking account any time zone changes that have taken place in the intervening years, and appropriately set reminder notifications.
If they were to store "X seconds from the time this message was sent", then any time zone change would likely make it not fall at 6pm on the target day, so that's not what they'd want.
This is why storing UTC dates for future events is insufficient: if the event is actually specified in local time, the date is incorrect when the time zone rules are changed. But storing the time zone is insufficient if the time zone that applies to the event also changes; you also need to store enough information to reevaluate which time zone is applicable.
Of course, it can be difficult to gather this information in a user friendly way, so you know, compromises.
One could imagine using geo coordinates or similar, but the mapping from those to timezones (or from/to zip codes or area codes) is already not precisely defined.
If you use city names, those might also be split/merged (Berlin) or renamed (Constantinopel).
There is actually a good read on this at https://www.ordnancesurvey.co.uk/blog/is-britain-on-the-move
There's 4 things at play here:
- Coordinate location on the planet
- Identifier for that location
- Political entity for that location
- Current timezone policy
Of those, coordinates are the only thing that doesn't change over time (for the spans we're talking about).But are also a pain in the ass to use. F.ex. I'm sure someone on HN has the lat long for London memorized, but I don't.
You could develop a way to specify a location and indicate that you mean 'local time' at that location.
Coz change like that could fuck some shit up...
[0] https://github.com/eggert/tz/commit/e13e9c531fc48a04fb8d064a...
For example: https://data.iana.org/time-zones/tzdb-2020d/europe (search for Kiev for the specific part; it's a very long file)
[0] https://turismo.buenosaires.gob.ar/en/article/what-where-and...
Time zones are political | * social* especially in the twilight zone between two otherwise well defined zones.
If a country is mostly in TimeZone X then often an extrusion that goes well into TimeZone Y will remain with clocks aligned to TZ-X unless some local political change is made (to be more or less sensible).
See (current TimeZone Map):
https://www.timeanddate.com/time/map/
and note that cities have changed time zones (not daylight savings changes, actual changes to core time zone) in the past and will almostly certainly do so again in the future.
*Every single time* I update the tz source file some arbitrary set of zone names and offsets change. Look at the churn and enjoy the schadenfreude: https://github.com/photostructure/tz-lookup/commits/main/tes...
Not only is that not true, but there are places on the earth where one country may think the timezone is X, but in another country it is illegal to claim that the timezone is X.
This happens most notably with China, which defines the entire country to be in a single timezone, and is engaged in multiple border disputes.
2030-07-01T18:00:00~Scotland/Glasgow ?Or be in the middle of a political dispute, with different times being used depending which side one is on, like Xinjiang. So just knowing the place and local time isn't enough.
I think you need to be more specific here.
Whether your calendar software will let you choose how it expresses the timezone and whether the recipient's calendar software will store it that way is another question...
And likewise in PostgreSQL you can store timestamp without time zone.
Combine that representation with lat/long gps coordinates and you have what you need for scheduling future events at specific locations regardless of changes in time zone names and offsets.
Sadly, iCalendar is very much tied to using timezones for locations. I expect that if/when Europe finally gets round to abolishing DST, there will be some significant changes to the timezone boundaries, and as a consequence, much hilarious calendaring failure. Dunno if it will affect as many people as the 2007 DST changes in North America, which caused a lot of extra work for people running Microsoft Exchange, because it was designed assuming that timezones never change. And this design error carries over to iCalendar, tho (apart from tz boundary changes) it is better than it was.
event://de/Berlin/10557/Platz+der+Republic,+1/Bundestag#2030-08-30T18:00Use GPS coordinates instead :D
International disputes make it difficult to answer a lot of questions about specific locations without making choices about which authorities you’re willing to respect.
Value 0 meaning “if there is a DST switch, interpret the time as the chronologically earlier one”
Value 1 meaning “if there is a DST switch, interpret the time as the chronologically later one”.
But you still need to handle the case where the local time is skipped. You could pick the timestamp during which the skip happens, but that'd lead to an offset that can contain fractional seconds, which almost no datetime library supports.
[1]: https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a...
If the UK changes its rules before that time, then the timestamp becomes "inconsistent" (see section 3.4). The behavior on an inconsistent timestamp is left for the application to decide, but if a ! character is included within the brackets before the timezone name, then it's at least obligated to detect the problem instead of blindly following the UTC offset:
> In case of inconsistent time-offset and time zone suffix, if the critical flag is used on the time zone suffix, an application MUST act on the inconsistency. If the critical flag is not used, it MAY act on the inconsistency. Acting on the inconsistency may involve rejecting the timestamp, or resolving the inconsistency via additional information such as user input and/or programmed behavior.
This extended timestamp format is used in the proposed Temporal library for JavaScript [1] (though I'm not sure if it supports the ! character). The ZonedDateTime.from() parsing function [2] takes an optional "offset" parameter to allow the user to control which part of an inconsistent timestamp takes precedence. It also supports simply omitting the UTC offset and using only the timezone, but it warns that this is ambiguous for times in the repeated hour during a DST transition.
[0] https://www.ietf.org/archive/id/draft-ietf-sedate-datetime-e...
[1] https://tc39.es/proposal-temporal/docs/strings.html#iana-tim...
[2] https://tc39.es/proposal-temporal/docs/ambiguity.html#ambigu...
` 2030-07-01T18:00:00[!Local] `
Where no offset and the !Local tell the app to use OOB defined location?
2030-07-01T18:00:00~BTC
2030-07-01T18:00:00~CEST
2030-07-01T18:00:00~Local
2030-07-01T18:00:00~Europe/Warsaw
to signify it is not a constant point in time but timezone-at-the-time dependent.This time description in the indicated timezone, at the instant it is correct? (Ignore updates, I mean the time I said. E.G. The doors open at 8am every day.)
An indicated end of a duration, such as the period of time a mass of decaying radio-isotopes are valid for the sensor during? (Offhand, no consumer equipment comes to mind, but for an extremely sensitive calibrated sample it could matter and this is a contrived example.) Exact moment in monotonic time. (What about stretchy leap seconds too?)
Something between the two extremes?
Most humans probably want a default of something like...
"Looser more common use time unless I get more specific." So if a TZ is included, it isn't a fixed moment, but whatever specifier is the valid moment as that moment passes. Convert it to an absolute monotonic value at that time to record the event and not just the specification of when to capture the event's passing.
E.G. Unix time Epoch was 1970-01-01 00:00:00~Z with an absolute reference value of 0s DATE RoundedHour~US.EST => Actually is EDT but most people don't use that notation, and congress changed when DST happens yet again without abolishing it too, and this happened last year before the change but the event did run from Noon to 9PM with these event moment second values...
It would simply mean the time which is intended. It’s true that the instant isn’t known until it happens (or however much leeway precedes a TZ change). It’s generally always better to record intent, than to be smart and translate inputs to something else.
To map to a specific instant in UTC time, you use the string plus a db. The db can change in the future, and that’s ok. You simply update in the presentation layer in case you have any “2h left” strings or calendar entries. Note you should NOT store the mapped instance in a db before the event has occurred (and even then it’s unnecessary since it’s fixed).
I really don’t like the “inconsistent” mutable property and agree with parent that offset should not be part of the format. That would make it extremely easy to overlook or misuse.
Perhaps I’m missing something?
However I'm saying that the solution should be radically different and much more user focused.
There is a difference between a description of when to capture a moment (which should favor the way the normal person describes moments) and an absolute moment event.
Yes, you’re missing something - geography. “Local time” doesn’t include a frame of reference. If you want to have a meaningful representation of local time you need syntax to specify where, probably Lat/Long.
Then, periodically, the computer can look up the lat/long to see what the rules are there for time, and compare vs the target time.
But even THAT doesn’t solve the problem, because you probably don’t want the computer in a tight loop of looking up location rules for time and checking time. But if you do it periodically then there is a nonzero chance that you will miss the event because the rules changed since the last check and the current check happened after the event.
And you can’t just use the city names for time zones (e.g. “Europe/London”) because only a very small number of places have such names, and because they really refer to a combination of time zone and DST rules, not to a city, they just choose representative cities.
Finally, ISO 8601 does support durations, which RFC 3339 does not, so ISO seems more useful in that regard, but durations are not relative to any epoch.
So what happens when a timezone name changes?
Say Manila timezone changes names to New Beijing timezone in the next 10 years (fictive example)?
If the 'Asia/Manila' timezone changes to the 'Asia/Shanghai' timezone, the old timezone will still exist, but a rule will be added to indicate the change.
The tz name here is a specific name in the tzdata database, so it's quite easy for that database to never remove any entries, but to rather deprecate them or link them to new ones, if appropriate.
All our common date time formats are intended to represent a specific point in time and this you just do not have in your case. But it is actually not too uncommon that date and time specifications have a non-trivial structure, think a meeting on every last Friday of the month or a monthly meeting series starting on January 31st or two days before the end of each quarter.
I would guess trying to come up with a standard that covers all the things people could come up with, would become quite complex quickly. So if simple dates, times or instants are not good enough, you are probably on your own, make some structure with all the required things.
Theoretical arguments are nice, but in the real world, meetings are regularly scheduled were one or all people aren't physically at the location, say the company's headquarters, but the local time zone and its DST shifts are obviously still respected.
The only gotcha about such a thing is that there are ambiguous or impossible timestamps: 2023-11-05 01:30:00 America/New_York — that's one of two different times.
For calendaring, it would make sense, since "same wall clock time regardless" is what most people want¹; there might be some UI difficulty/challenges to handle the weird times, and maybe one might want to have a way to specify a disambiguation in the syntax.
Thankfully for calendaring those are usually in the middle of the night, but I've literally seen this happen in my career.
¹though once you invite the first person in a zone that doesn't do DST madness, note that this causes the calendar time to wobble on their calendars. Some of my international coworkers have to put up with this.
But when CA switches to PST (Pacific Standard Time) the meeting shifts to 8AM for the people in CA.
But if the people in CA lead, and always want the meeting at 9AM local time, then the meeting for the people in Phoenix will move from 9AM to 10AM and back.
Can't have it all.
Part of what makes TZ discussions incredibly difficult is that people play fast and loose with the terminology.
I think the person you're responding to is simply saying that if you made the meeting in a non-DST observing zone, the meeting time would still wobble in a DST-observing zone. (I'm not sure why they're noting it, because my comment also clearly spells that out, too, albeit in reverse. But yes, it works both ways.)
I know it works both ways, too, but probably would be better for the DST observing zone to deal with the effects of DST, instead of foisting such side effects onto our international friends.
This takes a bit more effort, but it is less ambiguous and saves you from having to deal with the insanity that is time. DST switching will still cause issues but, as long as you're not the one cursed to implement that software, it should be fine with advance warning.
Yes, and maybe East London secedes from the UK and uses a different time zone, so Europe/London doesn't specify the time zone you meant, anymore. This might not be likely for London, but if it's in the countryside of a less stable country and you just specified the time zone as the capital city, this might happen.
I prefer time formats that are actually implementable and don't depend on a large database that can change at any moment.
Countries change. Timezones change by decree. This is a pain but it’s the real world and our tools need to be able to deal with it. I don’t like it either, and no one cares, nor should they. Reality trumps preference.
The tz database is updated on average every two months, and that doesn't happen without reason. Countries keep changing their timezones, and a rather high-profile one is the European Union's plan to get rid of DST over the next few years. This is already happening in Greenland this year. Some Muslim-majority countries also like to make their DST depend on Ramadan - which falls on a different and somewhat unpredictable date every year.
Like it or not, if your code uses future dates and does not rely on "Europe/London"-style timezones, you will be slowly corrupting your data.
How so? 2030-07-01T18:00:00+01:00 is a well-defined point in time, is it not? It may or may not be local time in London, but it's unambiguous.
July 1st 2030, at 6pm, Europe/London is not. What's broken is the idea that you can somehow standardize "local time at a particular place" in a way that magically survives any arbitrary policy change.
> Some Muslim-majority countries also like to make their DST depend on Ramadan - which falls on a different and somewhat unpredictable date every year.
Thus proving that what you want does not exist and cannot exist.
Being unambiguous isn't helpful if it is wrong. It is a very common desire to want to set a meeting based on the local time of a destination. The only future-proof way to store such a time, is to remember the destination and the desired local time. This is the only way the proper moment can be calculated and kept in sync with reality.
The unfortunate fact is, the local time could be altered by decree, in any number of ways, in the interim timespan between setting a reminder, and when it happens.
It's a redundant way of writing 2030-07-01T17:00:00Z which only serves to cause confusion (it misleadingly looks like a local time, but it isn't). TAI or equivalent are useful; symbolic timezones are useful; numeric time offsets are useless and there's no benefit from having them be part of the standard.
> Thus proving that what you want does not exist and cannot exist.
Of course it does; 2030-07-01T18:00 Africa/Casablanca is a real time that humans will have no trouble attending a meeting at, and nor will computers as long as they've been keeping their zone file up to date. All we need is a standard for storing and interchanging it on computers.
No, the reason people use it is because they don't want to add the timezone offset and want a timestamp that's intuitive.
Not consciously. But they think it's always going to match the time on the clock in their office / on their town hall / on their phone. No-one deliberately writes a time in the time offset corresponding to their local winter time for an event that will happen in their local summer time (or vice versa).
> want a timestamp that's intuitive.
I don't know about "intuitive", but they want to write times in their local civil time.
True, but unfortunately humans only care about local time. Setting a meeting for "6PM London time" is how pretty much the entire world operates. If your app can't deal with that, your app is doing it wrong. The world doesn't care that it isn't "well-defined", as developers we just have to deal with it.
> Thus proving that what you want does not exist and cannot exist.
But it does exist, and many calendar apps operate exactly like that. It just requires them to update their timezone database every few months - which in many cases already happens automatically as part of OS updates.
"2030-07-01T18:00:00+01:00" conveys no more information than "2030-07-01T17:00:00Z". The UTC offset is meaningless because it is impossible to get a timezone from it, so it cannot be fixed in the future. It essentially screams "we tried to do local time and failed".
2030-03-24 01:30:00 Europe/London seems like a perfectly reasonable time stamp. But if the UK decides to move BST forwards by a week between now and 2030, that time won’t ever happen.
What's unreasonable is wanting this to be one piece of information.
Location and time are distinct concepts that need to be split up.
A timezone is not a location. Timezones are just a subjective shorthand convenience for display purposes, not actually tracking time. The reason the abstraction sucks is because the idea sucks.
Got it in one. Relativity, universal time, the human circadian rhythm...
To quote my all time favourite HN comment quoting Plautus (presumably taken from R.R.J. Rohr's 1970 Sundials: history, theory, practice):
> The gods confound the man who first found out how to distinguish hours! Confound him, too, who in this place set up a sundial, to cut and hack my days so wretchedly into small portions! When I was a boy, my belly was my sundial — one surer, truer, and more exact than any of them. This dial told me when ’twas proper time to go to dinner, when I had aught to eat; But nowadays, why even when I have, I can’t fall-to unless the sun gives leave. The town’s so full of these confounded dials the greatest part of the inhabitants, shrunk up with hunger, crawl along the street. — Plautus (c.254-184 BC)
When I worked on a system that provided schedules for appointments, it was quite difficult to furnish a link that put this on someone's calendar reliably, and to set up reminders that went out every third Monday of the month at 9am to remind people to go to their clinic appt at 11am. People are equally annoyed at 8am or 10am reminders in such a case, so you can't tie it to a specific time, and daylight savings time gets changed from time to time, and various locations have "9am" at different times. We didn't even get into the weeds of whether someone who lives in Phenix City, AL should get notices in Central or Eastern (it's Eastern for most people, except if they work for the government or are going to school... unless it's a private school, which might still be on Eastern...).
Telling someone they can get their notice at any time they want as long as it's specified in UTC year round just doesn't solve the problem they have.
The date can be stored together with the time as a timestamp, but all timestamps need to be in UTC. Getting the user's locale and applying their timezone is done on the client side. What matters to people stays on the client side.
Date time + lat/long?
e.g.
2019-8-5 // August 5, 2019
5081-03-30 // March 30, 5081
-300-12-21 // December 21, 300 BC (proleptic Gregorian)
20-01-01 // January 1, 20 (NOT 1920, NOT 2020)
09:04:21 // 9:04:21 UTC
23:59:59.999999999 // 23:59:59 and 999999999 nanoseconds UTC
12:05:50.102/Z // 12:05:50 and 102 milliseconds UTC
4:00:00/Asia/Tokyo // 4:00:00 Tokyo time
17:41:03/-13.54/-172.36 // 17:41:03 Samoa time
9:00:00/L // 9:00:00 local time
2019-01-23/14:08:51.941245 // January 23, 2019, at 14:08:51 and 941245 microseconds, UTC
1985-10-26/01:20:01.105/M/Los_Angeles // October 26, 1985, at 1:20:01 and 105 milliseconds, Los Angeles time
5192-11-01/03:00:00/48.86/2.36 // November 1st, 5192, at 3:00:00, at whatever is in the place of Paris at that time
1985-10-26/01:20:01.105+0700 // October 26, 1985, at 1:20:01 and 105 milliseconds, UTC+7:00
2000-01-14/10:22:00-0200 // January 14, 2000, at 10:22, UTC-2:00
ISO 8601 and RFC 3339 are fine for dates in the recent past, but they're not great as a general time format.Define whatever format you want, and there's always the possibility of a politician changing what the local time is.
Historically, the offset against UTC has changed by a few minutes, hours, or days. Is daylight savings used? When? It is not even certain that it is the same calendar that is used, or that there are 24 hours per day, when the day starts, which months there are, or which month is the first of the year.
If the time zone changes in the future, so that the specified local time no longer corresponds to the same time in UTC, then the time of the event has changed, even if the organizer still specifies 6 pm.
There are disadvantages too of course, one of which is overlap between airport codes and currently existing timezone codes. This led me to discover a couple of airports that have the same code as their timezone.
It is an extreme example but if you look at e.g. certain parts of Africa or Middle East…
It makes sense to me that it is not provided as it is something fundamentally different. ISO 8601 / RFC 3339 are just textual representations of specific[*] time moment (or interval), that could be easily converted to different definitions of time moments.
OTOH, specifications like '2030-07-01 18:00 local time in London' are not a definition of a specific time moment, the are really a description of a condition, and we cannot resolve it to a specific time moment before it happens.
So these are two fundamentally different concepts that does not make sense to put into one category.
[*] If we ignore leap seconds
I don't think it's unreasonable to want to be able to specify a meeting in London, on July 1st 2030, at 6pm local time - no matter what happens to UK timezones between now and then.
The UK currently uses Z+00:00 from November to March, and daylight savings of Z+01:00 from April to October (roughly)[0]. But it's possible that between now and 2030 they might adopt Central European (Summer) Time[1], or retry British Double Summer Time[2], or scrap daylight savings entirely. Therefore, what happens to 6pm with respect to any given epoch might vary wildly between now and 2030.
But it would be nice to set a calendar event for "6pm London time", whatever London time happens to be when the event rolls around. But there's no standardised interoperable way to say "2030-07-01 18:00:00 Europe/London".
[0] https://en.wikipedia.org/wiki/British_Summer_Time
[1] https://en.wikipedia.org/wiki/Central_European_Time
[2] https://en.wikipedia.org/wiki/British_Summer_Time#Periods_of...