the dawn of time is a separate edge case
July 3, 2018 5:05 PM   Subscribe

Years ago, I worked with a friend who had built a few scheduling calendars in a previous freelancing gig. Sometimes we’d be working on something that tangentially related to time, and as kind of a recurring in-joke he’d always tell me: Zach, whatever you do: just don't ever build a calendar.
Anyway, I’m Zach Holman and I’m building a calendar.

1967: Atomic standard
The world started standardizing on what time measurements actually are.

If you have a pile of Cesium atoms sitting in your backyard, go out sometime and measure 9,192,631,770 energy transitions of a single atom of Cesium: because that is exactly the duration of a second, settled upon in 1967 by a bunch of scientists.

Nowadays, our atomic clocks are accurate to losing a single second over the course of a few hundred million years. This is something like only losing two nanoseconds of accuracy a month, which definitely accounts for why I'm always late to your meetings on Monday morning.
posted by ErisLordFreedom (47 comments total) 62 users marked this as a favorite
 
I lost this post for weeks because I thought I'd seen it on Metafilter, and I searched through all the possible tags I could think of but couldn't find it. It is also nearly impossible to Google-find a longform article about writing a calendar app instead of "top recommended calendar apps" listicles.

It's only partially about writing an app. A lot is about the history of the concept of time, and calendars, and timekeeping, and what we had before time zones (I believe the layman's term is "utter chaos, with charts attached") and he's got plenty of mini-rants about terrible attempts at calendar-based software, although he still offers some sympathy because the underlying source material is deeply weird and politically unstable.
posted by ErisLordFreedom at 5:16 PM on July 3, 2018 [2 favorites]


Awesome post, thank you.
posted by signal at 5:25 PM on July 3, 2018 [1 favorite]


This was interesting; I enjoy this sort of in depth look at something people usually take for granted. But I found this tidbit a little fishy:

If you're like me and immediately said ohhhhhhhhhhhh, so THAT'S why there's twelve hours in a day! and immediately followed it up with: wait, why the fuck are they using twelve instead of ten? Base ten is lit and doing everything in twelve feels so uncivilized, well good use of "lit" there.

It's most likely because you have twelve joints in your hands: three in each of the four fingers, excluding the thumb. I thought that was pretty nifty to discover. Like, I had never looked at my hands before, really. Hands are really wild, when you think about it.


Even after reading the linked article I wasn't convinced. It seems to me if the Egyptians were building new and improved sundials they were probably able to count to twelve without using their fingers. The fact that 12 is evenly divisible by 2,3,4,and 6 seems like a more likely explanation for it's widespread use in ancient times.

That small complaint aside, after time and calendars get fixed, can we get databases to handle surnames?
posted by TedW at 5:27 PM on July 3, 2018 [9 favorites]


can we get databases to handle surnames?

As a person who has done a lot of database work, I can assure you that you are just a number to me.
posted by thelonius at 5:29 PM on July 3, 2018 [26 favorites]


Not surprised that the February 30 thing was because of this goat rodeo.
posted by thelonius at 6:15 PM on July 3, 2018 [2 favorites]


Not to be confused with Suriname.



Or surnames with spaces.

I think the divisibilty is a more likely scenario for 12s. Though it gets confusing when you think we’re measuring 12s while given up nearly all other units of measure in daily life that isn’t base ten.


But I think the twelve thing is solid “divisible by two”. You ever try to cut a bag of grain into tenths by dividing each portion by two over and over? Not happening.
posted by tilde at 6:16 PM on July 3, 2018 [4 favorites]


2005: G. W. Shrub changes DST and since your embedded device's kernel is not remotely updatable you have to write your own daylight savings routine
posted by RobotVoodooPower at 6:31 PM on July 3, 2018 [4 favorites]


Sorry for the thread shit, but. An ex of mine and I decided to make a calendar that had, I think, even calendars with six day weeks. The, damn I wish I could remember it, left over days would be between the months. There were three. We called them Moeday, Larryday and Curleyday. Each month had work days. And one day off. Moe, Larry and Curley days were holidays. We may have been really high. Not may. We were.
posted by Splunge at 6:45 PM on July 3, 2018 [9 favorites]


The linked article refers to the Olsen Database (which I'm pretty sure I first learned about here on Metafilter), but you really need to dig into it to appreciate how crazy it is.

This covers some of the highlights. The section on Antarctica is relatively short and contains this gem:
One last quirk about South Pole time.
All the electric clocks are usually wrong.
Something about the generators running at 60.1hertz or something
makes all of the clocks run fast.  So every couple of days,
we have to go around and set them back 5 minutes or so.
Maybe if we let them run fast all of the time, we'd get to leave here sooner!! 
posted by adamrice at 7:02 PM on July 3, 2018 [10 favorites]


I have not finished R’ing the FA yet but as a developer who is so timezone impaired I can’t even successfully schedule a MEETING in OUTLOOK with someone two time zones away, I am actually crying from laughing so hard reading this.

THANK YOU for posting!
posted by hilaryjade at 7:03 PM on July 3, 2018 [4 favorites]


I laughed in pain as I read this.
posted by jacquilynne at 7:28 PM on July 3, 2018 [3 favorites]


Related
posted by juv3nal at 8:02 PM on July 3, 2018


What is clocks?
posted by feckless at 8:08 PM on July 3, 2018


I love this side note from a stackexchange answer linked by the article. I'm kind of embarrassed that I never reached this conclusion for myself.
[C]onsider that "a.m." and "p.m." are abbreviations for "ante meridiem" and "post meridiem," which mean "before noon" and "after noon," respectively. Since noon is neither before noon nor after noon, a designation of either a.m. or p.m. is incorrect. Also, midnight is both twelve hours before noon and twelve hours after noon.
12:00 a.m. = midnight
12:00 p.m. = also midnight, deal with it

Timekeeping is such a deep and wonderful well of weirdness.
posted by Lirp at 8:48 PM on July 3, 2018 [11 favorites]


This thread needs a link to that fantastic article from a few years ago that explained how mind-blowingly difficult it was to work properly with Unicode.
posted by intermod at 10:36 PM on July 3, 2018 [1 favorite]


There are a few problems with building a database for names. Namely, people's names have a lot of problems. "Falsehoods Programmers Believe About Names." An excerpt of an excellent article.

...
21. People’s names are globally unique.
22. People’s names are almost globally unique.
23. Alright alright but surely people’s names are diverse enough such that no million people share the same name.
24. My system will never have to deal with names from China.
posted by misery loves company at 10:46 PM on July 3, 2018 [5 favorites]


I can handle some advanced calculus no probs. But every frigging time I have to do something involving noon, I am back to counting on my fingers. I hate noon. I know I should just 24-hour it, but midnight/noon makes me bug-eyed with rage.
posted by dorothyisunderwood at 11:09 PM on July 3, 2018 [2 favorites]


Leo Frankowski's book series about a time-travelling engineer aren't the greatest literature in the world and are problematic in different ways, but they are quite entertaining and one of the things that stuck with me is that the protagonist went with a base-12 numbering system when he had to educate medieval Poland. A lot of stuff was made easier by 12 being divisible by 2, 3, 4 and 6, and I think even some constants like e and Pi were "rounder" numbers than in base-10.
posted by Harald74 at 11:48 PM on July 3, 2018 [4 favorites]


Potter Stewart was the US Supreme Court justice who said, in the case Jacobellis v. Ohio (1964), “I shall not today attempt further to define (pornography)… But I know it when I see it…”

I was reading In Praise of Slowness by Carl Honoré, and he quotes Augustine: “What then is time? If no one asks me, I know: if I wish to explain it to one that asketh, I know not…” (Book XI, ~400AD)

So Mr. Stewart had a bit of prior art on that idea.
posted by aurelian at 11:59 PM on July 3, 2018 [1 favorite]


Do network time protocol next!
posted by benzenedream at 12:38 AM on July 4, 2018 [2 favorites]


12:00 a.m. = midnight
12:00 p.m. = also midnight, deal with it


Or in 24 hour/military time, 00:00 = midnight, and 24:00 = midnight. Which is why I write 12:00n and 12:00mn, which is so unambiguous that it would pose no problem for a computer.
posted by TedW at 1:59 AM on July 4, 2018 [2 favorites]


My favorite excerpt from the article adamrice linked on Antarctica:


From Paul Eggert (2001-05-04): This seems to be hopelessly confusing, so I asked Lee Hotz about it in person. He said that some Antarctic locations set their local time so that noon is the warmest part of the day, and that this changes during the year and does not necessarily correspond to mean solar noon. So the Vostok time might have been whatever the clocks happened to be during their visit. So we still don't really know what time it is at Vostok. But we'll guess +06.

posted by nat at 4:12 AM on July 4, 2018 [5 favorites]


This is fantastic. Also for the bottom links, where TIL Why clocks go clockwise
posted by Mchelly at 4:12 AM on July 4, 2018 [2 favorites]


If your main interest in numbers is trading goods, twelve in a box packs more handily than ten, as well as dividing better. It’s then almost automatic to start speaking of so many boxes (twelves) plus whatever’s over. You’ve got a duodecimal system before you know it.
posted by Segundus at 4:29 AM on July 4, 2018


Or in 24 hour/military time, 00:00 = midnight, and 24:00 = midnight.

I've never seen 24:00, though - and if so, why not 25:00 for 1 AM, etc?

Meantime, who remembers Swatch Internet Time? Coming up on the twentieth anniversary of its launch by Nicholas Negroponte - a name which will go down in infamy as the dark kiss of death to digital dreams, so it never had a chance.
posted by Devonian at 4:37 AM on July 4, 2018 [1 favorite]


I've never seen 24:00, though - and if so, why not 25:00 for 1 AM, etc?

Midnight Military Time – 2400 or 0000?

After 24:00 you go to 00:01, not 24:01, so no 25:00
posted by TedW at 5:19 AM on July 4, 2018 [1 favorite]


What I enjoy is when I have a recurring meeting, say Fridays at 10am, and Chile changes to DST, or doesn't but Google thinks we should, so they change the time of my recurring meeting to 11am (or maybe 9am) because of course they saved it in UTC + offset, and couldn't be bothered to figure out that maybe, just maybe, 10 am still means 10 am.

When I've complained, the explanation is somewhere along the line of 'but what if you have a meeting with someone in another timezone', which is a great example of an edge case screwing up things for the vast majority of non-edge cases.

Timezone aware times should be opt in, as 99% of the world's population does not schedule events with people in different time zones. I blame the fact that Google engineers and their kin do, so they assume this is normal for most people, so they decide to make it the default.
posted by signal at 5:53 AM on July 4, 2018 [1 favorite]


I've never seen 24:00, though - and if so, why not 25:00 for 1 AM, etc?
24:00 lives on in data logging systems, and is expressly allowed it ISO 8601 (but smashed to 00:00 by most POSIX-inspired libraries). You might see it in utility metering. Before we had clever databases that handled time intervals, metering timestamps would read 00:00:01–24:00:00 to avoid an off-by-one error that would include the last record of the day as the first record of the next.

Deutsche Bahn's printed european timetables used to include hours >24 for trains departing before midnight but arriving some time after. So your train might run from 23h00–25h00, most likely to keep staff pay systems simple and keep the under-appreciated timetable typesetter wanting to kill you just a little less.

I'd like Zach's calendar if it could set a recurring appointment on the second last Friday of the month. When I needed such a thing (circa 2009), Outlook, Apple Calendar and Google Calendar didn't support it. Had to revert to some ugly Excel, though the gloriously baroque Perl library Date::Calc and old standby PCAL are all about it.

Isn't it lovely when something expected to be precise ends up being a hack like everything else?
posted by scruss at 5:59 AM on July 4, 2018 [4 favorites]


Most informative.

For a dozen years I supported a product that included tracking pharmacokinetic events, and we never got all the bugs worked out, although I think we got it down to 2, and both involved DST:
- if you're doing a blood draw recurring every day, do you want to keep it at 24 hours, or add/subtract an hour so the draw is at the same time of day? Different labs handled it differently, and we never provided an option for them to choose.
- time stamps were saved in UTC, but displayed in local time, so there was conversion. If the server was in a different time zone from the user weird shit happened, especially in the fall when there was no way to input which, say, 1:30AM it was.
We had meetings four or five times to try to sort these issues out, but every time every one of us got severe headaches.

Swatch Internet Time is new to me. I can't tell if it's a stupid joke or deeply brilliant.
posted by MtDewd at 6:30 AM on July 4, 2018 [2 favorites]


In recent horrifying calendar news,

The Japanese Calendar has Japanese Era Names that coincide with the reign of the Emperor. For most of the modern age of computing that has been the Heisei era, however the Emperor is expected to step down on April 30, 2019. Which will bring about the beginning of a new era. Fortunately, this is a rare event, however it means that most software has not been tested to ensure that it will behave with an additional era... There are several interesting conditions that an additional era provides and current software may not expect:
posted by sourcejedi at 6:46 AM on July 4, 2018 [4 favorites]


Yesterday I learned that excel won’t recognize ISO8601 if you use it to open a CSV. I was writing a quick script to pull some issues from Jira via the REST API, which uses ISO8601, and then I had to spend a bunch of extra time handling which of the varying export fields might be datetimes and having Powershell convert them to a format Excel likes. Oh but the dates may be empty, hang on. There’s no escaping this shit.
posted by freecellwizard at 6:55 AM on July 4, 2018 [1 favorite]


Details like Japanese Era dates are why we can't have nice things ... I wonder if there's a tidy Japanese standard to handle this potential mini local Y2K?
posted by scruss at 9:25 AM on July 4, 2018 [1 favorite]


There’s no escaping this shit.

Time comes for everyone.
posted by nubs at 9:35 AM on July 4, 2018 [2 favorites]


adamrice, that post about the Olson / tz database is mine, from 2009. I'm gratified it's remembered!
posted by Pronoiac at 10:16 AM on July 4, 2018 [4 favorites]


Remembered indeed, Pronoiac. adamrice posted last in that thread!
posted by cgc373 at 10:20 AM on July 4, 2018 [1 favorite]


Details like Japanese Era dates are why we can't have nice things ... I wonder if there's a tidy Japanese standard to handle this potential mini local Y2K?

It seems that it should be a straightforward lookup table or case statement to produce an era name at the presentation level, and sane people will store and manipulate the date as UTC. Maybe I'm missing something, but it just doesn't seem like a big deal.
case
  year > 1988 AND year < 2019: era = "Heisei";
  year  > 1925 AND year < 1989: era = "Showa";
  ...
end case
Oddly enough, I was living in Japan during the last era-name transition (Showa to Heisei). I don't recall discussion of Y2K-like problems then, but the Internet was obviously much less pervasive then. So interop wasn't a big deal, and companies could deal with it internally as they saw fit.

One thing that's weird about era transitions is that the transitional year retroactively becomes the first year of the new era. By happenstance, the Showa emperor (Hirohito) died on Jan 8, so we hadn't gone too far down that path, but I do remember finding a rare ¥10 coin dated "Showa 64." What's interesting about the upcoming transition is that the date is known ahead of time. There's been some hand-wringing in Japan over whether the emperor can step down (though it's not without precedent). Yes, I know we'll be in the Heisei era for part of 2019, until the new era name is declared. So yes, not quite as simple as I showed above. But by 2020, the above case statement will be valid.
posted by adamrice at 10:56 AM on July 4, 2018 [1 favorite]


Converting that way's easy, but can you imagine an Excel sheet made in 2021 with the year stored as 2: is that 1926 (Showa 2), 1989 (Heisei 2), or 2020 (the future emperor)?
posted by scruss at 12:52 PM on July 4, 2018 [1 favorite]


It seems that it should be a straightforward lookup table or case statement to produce an era name at the presentation level, and sane people will store and manipulate the date as UTC. Maybe I'm missing something, but it just doesn't seem like a big deal.
case
year > 1988 AND year < 2019: era = "Heisei";
year > 1925 AND year < 1989: era = "Showa";
...
end case


Is it? If I put in 7 January 1989 it'll say Heisei 1 when it still should be Shōwa 64. Heisei 1 didn't start until the 8th January.
posted by Definitely Not Sean Spicer at 1:16 PM on July 4, 2018 [1 favorite]


scruss—I can't seem to get Excel to use Japanese era names at all, but we have a similar problem with the Gregorian calendar when you enter an incomplete year. If you put in "17 Feb 30" as a date, Excel normalizes that to 1930. If you put in "17 Feb 29," Excel normalizes it to 2029 (and is obviously assuming you mean AD). Clearly Microsoft has made some decisions about what dates people are most like to enter.
posted by adamrice at 1:32 PM on July 4, 2018 [1 favorite]


I really enjoyed this article but it was a bit remiss of the author to not mention that everyone talks about UTC but often uses IAT (international atomic time) without realising by ignoring leap seconds. It only makes a difference when encoding Unix timestamps, and the error is (fortunately) almost universal (python and JavaScript both do this), but it is a fun little pedantic distinction that the article is otherwise full of.
See this python bug for an example.
posted by jnnnnn at 2:29 PM on July 4, 2018 [3 favorites]


I was under the impression that part of the reason for the curse of 12s in our time telling system was that we inherited a lot of technical debt from the sexagesimal Sumerians. 12 goes evenly into 60, as does 10.
posted by ivan ivanych samovar at 2:50 PM on July 4, 2018 [1 favorite]


Back when I worked in perinatal research (and likely still) to avoid confusion there was a convention that as far as the medical records went, no baby was ever born at midnight. There were babies born at 23:59 and there were babies born at 00:01, but there were no babies born at midnight.
posted by Lexica at 4:39 PM on July 4, 2018 [5 favorites]


Steven Johnson's "How We Got to Now" had a good episode about Time, which I could stream thanks to my library. I recommend it!
posted by Pronoiac at 5:58 PM on July 4, 2018 [1 favorite]


I have done a lot of reading about time handling for no apparent reason (oh, okay, it's really because at a previous job, I handled scheduling staff at a 24 hour facility and we would start cringing a couple weeks before the Saving Time shift because we knew AGAIN, the tracking and payroll software wouldn't handle it, despite what the well-established software company promised us THIS year, and we would, thus, upgrade to shuddering, self-soiling fetal positions as time passed), but this was the most amusing and engaging version I have seen yet.
posted by Samizdata at 11:30 PM on July 4, 2018


I used to work for a company which mined corporate communication data (with user permission only, of course). Calendars and meetings were more complex than any other means of communication by an absolutely huge margin and had me pulling my hair out for months.

There was a crashing bug which would occur seemingly at random. Turns out it was caused by having a recurring meeting series with one meeting that had people with two different time zones in it, and the meeting being scheduled in such a way that the local time of one of the attendants was February 29th and the other on February 28th or March 1st. We knew about a crashing problem related to calendar/recurring meetings since 2015, but we didn't actually pin down what was causing it until the actual leap year. I'm still mad about that one.

If I never work with calendars again it'll be too soon. Translating all these time hacks to software is SO fiddly.
posted by one of these days at 6:04 AM on July 5, 2018


Back when I worked in perinatal research (and likely still) to avoid confusion there was a convention that as far as the medical records went, no baby was ever born at midnight. There were babies born at 23:59 and there were babies born at 00:01, but there were no babies born at midnight.

And from personal experience, DON'T show up in active labor at 2am/1am on the night the clocks change backwards, because there will be no labor nurses on staff (they're all still working the other 1am from an hour ago) and you will have to scream and scream for someone to at least give you a tylenol before anyone notices you're there.

10 years later and I'm still bitter.
posted by Mchelly at 6:12 AM on July 5, 2018 [3 favorites]


A post has been made about the Japanese imperial era issue.
posted by Chrysostom at 2:54 PM on July 28, 2018


« Older The Annapolis shooting was an attack on a...   |   Ledger B, 1772 - 1793: pg.179 Newer »


This thread has been archived and is closed to new comments