2867: DateTime

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
DateTime
It's not just time zones and leap seconds. SI seconds on Earth are slower because of relativity, so there are time standards for space stuff (TCB, TGC) that use faster SI seconds than UTC/Unix time. T2 - T1 = [God doesn't know and the Devil isn't telling.]
Title text: It's not just time zones and leap seconds. SI seconds on Earth are slower because of relativity, so there are time standards for space stuff (TCB, TGC) that use faster SI seconds than UTC/Unix time. T2 - T1 = [God doesn't know and the Devil isn't telling.]

Explanation[edit]

Ponytail asks Cueball how to calculate the time elapsed between two instants. A Cueball not intimately familiar with the complexities of the way humans measure time naively assumes that this is given by the difference of the timestamps. A Cueball who is familiar panics and states that it is impossible to know, and further that it is forbidden to even ask the question.

Randall's use of the term "DateTime systems" covers any number of situations, and the complexities are hardly confined to any particular programming language, or indeed computers as a whole. Some of these complexities include time zones (and changes to time zones), the international date line, daylight saving time and differing observation (or non-observation) thereof in different areas (and changes to the observation of daylight saving time over time), leap days and leap seconds, etc. Another complexity is found in relativistic effects, in which the flow of time varies depending on how deep in a gravity well one is; Barycentric Coordinate Time and Geocentric Coordinate Time (in French, TCB and TCG respectively - the reference to TGC in the title text appears to be a typo) are time systems used for space missions and orbit calculations that handle this and shortly after this comic was published it was announced that Coordinated Lunar Time (LTC) would be established. A partial list of such minutiae may be found at Falsehoods Programmers Believe About Time. The title text of the comic also references some of them. Depending on when T1 and T2 are, changes in calendar system may also be a relevant consideration—perhaps most famously, the change from the Julian calendar and the Gregorian calendar, two calendar systems which are nearly identical but nearly two weeks apart, and which different countries changed at different times.

The statement that "it is impossible to know" is because Ponytail did not provide enough information in the question: She needed to specify the location and time zone of both observations, and possibly the exact values of T1 and T2 to the nanosecond. Considering the restrictions imposed by relativity on two observers agreeing on the timing of events, it may be literally impossible to determine a value of T2 - T1 that is absolutely "correct" to arbitrary levels of precision.

The addition of "and a sin to ask" is hyperbolic. It implies that asking such questions is akin to attempting to acquire forbidden knowledge of the nature of God or the Universe, for example, through practices such as Numerology, which some may consider heretical. it's an expression of the fact that determining the answer accurately can be complicated, and programming systems that attempt to do this can be frustrating.

"T2 - T1 = [God doesn't know and the Devil isn't telling.]": This is a colloquial expression that riffs on the more common "God only knows" as well as "Hell knows and Heaven suspects", to suggest that the thing in question is even more unknowable than the usual type of unknowable thing, to the point where it may be an evil invention of the Devil designed to cause complexity and frustration for the people having to deal with it.

Transcript[edit]

[Ponytail is talking to Cueball.]
Ponytail: Event #1 happened at time T1.
Cueball: Okay.
Ponytail: Then event #2 happened at time T2.
Cueball: Mhmm.
Ponytail: How would you calculate how much time elapsed between T1 and T2?
[The comic splits into two paths, each with a caption at the top.]
[Path 1, upper right panel]
Caption: Normal person:
Cueball: T2 minus T1.
[Path 2, lower right panel]
Caption: Anyone who's worked on datetime systems:
[Cueball has his arms raised.]
Cueball: It is impossible to know and a sin to ask!


comment.png add a comment! ⋅ comment.png add a topic (use sparingly)! ⋅ Icons-mini-action refresh blue.gif refresh comments!

Discussion

Comics like this are why this wiki exists. 172.70.100.172 23:30, 13 December 2023 (UTC)

The time falsehoods gist linked above is a really good explanation about why a programmer might panic about calculating time. Especially the ones about calling "getCurrentTime()" twice in a row doesn't always mean the results are in the order you think they were called, or even different values. t2 might very well be the same or less than t1. It can be maddening. 162.158.197.149 23:40, 13 December 2023 (UTC)
The last item is the most important to me: Users prefer to use the local timezone. This causes so much frustration while browsing the web! PissedOff.gif --162.158.110.68 00:26, 14 December 2023 (UTC)
Worth noting that events can take place over long periods. A sunspot or an illness or a relationship doesn't happen at a single point in time, it takes place over days or weeks or longer. When did it "start"? Who knows? Also I miss calling TI4-1212 here in DC. 172.70.175.27 01:39, 14 December 2023 (UTC)
Out of curiosity, could someone explain the item in that time falsehoods list that says "Months have either 28, 29, 30, or 31 days"? My guess is that it's a reference to their being more calendars in the world than Gregorian? But I'm not sure if there's more than that going on, there.ModelD (talk) 18:18, 14 December 2023 (UTC)
Isn't that true of Gregorian calendars? February has 28 or 29 depending on the year, AJSN have 30 and JMMJAOD have 31.Gavin (talk) 18:33, 14 December 2023 (UTC)
It's saying that "months have either 28, 29, 30, or 31 days" is a falsehood. The first one that comes to mind is the switch from the Julian calendar to the Gregorian calendar: "In North America, for example, the month of September 1752 had only 19 days, as the day count went straight from September 2 to September 14". 172.70.43.108 21:03, 14 December 2023 (UTC)
(Ninjaed, with an actual example! But retrying reply anyway as it had other details.) But how many days had <insert your choice of month(s) during which a given system changed from Julian to Gregorian>? I think possibly, without looking up when each and every transition occured, below 20 days is possible. (As in the nth of one month to the nth of the next is less than 20 days, for the right month and a number of ns. For other ns, you can only actually count from the month before to the month after (two full calendar months), the daycount for that being below the typical bimonthly stretch of 59, 60, 61 or 62 days (under more standard conditions)... 172.70.90.48 21:07, 14 December 2023 (UTC)
The shortest month might be February 1923 in Greece, which had only 15 days. The most recent such instance seems to be December 1926 in Turkey, which had 18 days. 162.158.154.64 13:04, 5 January 2024 (UTC)

Related insanity on Computerphile with Tom Scott: https://m.youtube.com/watch?v=-5wpm-gesOY Fabian42 (talk) 03:54, 14 December 2023 (UTC)

Even with just Special Relativity, the question doesn't really make sense, because the answer will depend on the inertial reference frame. "Impossible to know and a sin to ask" is not a bad way to describe questions about non-invariants. 162.158.154.189 08:09, 14 December 2023 (UTC)

Is it even possible for two observers to agree on the answer and be sure that it's correct for both of them? BunsenH (talk) 16:53, 14 December 2023 (UTC)
In order to know if the answer to T2 - T1 is correct, you'd first have to know if T1 and T2 are correct. I'd say that's already impossible. 172.71.99.134 11:53, 18 December 2023 (UTC)

I can see Randall's point, so for your average everyday programming I'd say "please use a library function instead of trying to do it yourself, or you'll end up like the guy in the lower frame..." --IByte (talk) 11:02, 14 December 2023 (UTC)

When I googled "DateTime" all I came up with was Python libraries, nothing about relativity or other effects. Is that what Randall's talking about? 172.69.22.125 22:03, 14 December 2023 (UTC)

Ideally, the standard library functions for a language would cover many of the "quirks" without the programmer having to worry about remembering the details. The required inputs for the functions would be sufficient to determine the necessary offsets. But programmers still have to be careful about some of the issues, and not all languages (and their libraries) are sufficient for all situations. When things like relativistic effects have to be taken into account, the usual languages (and their libraries) don't have the needed flexibility/complexity and precision. BunsenH (talk) 00:18, 15 December 2023 (UTC)
I should clarify, I'm not saying the Python library doesn't have functions for those quirks. I'm just asking: what does Randall mean when he says "DateTime" (two capital letters, no space, as per the comic title)? Is he talking about the Python library? Or something else I didn't find yet?172.69.134.163 02:51, 15 December 2023 (UTC)
Doesn't matter. For one the usage of CamelCase in such cases is pretty much standard regardless of language and besides of that the problems he's talking about/implying are pretty much true for every language. Elektrizikekswerk (talk) 10:58, 15 December 2023 (UTC)
OP, I suspect your Google cookies/whatever are just too used to serving you answers to Python questions, as being the answers you most like to visit. I just added to the "it's definitely Python" explanation another three more (of an easy dozen or so, before I gave up) links that I found from searches for "DateTime library <language>", or equivalent. And even those that didn't give that exact wording in their actual modules tended to have "What's the standard DateTime library for <foo>..?" as an FAQ (including LISP, Forth, COBOL, even a few for one or other Assembler variant, which I tried just for laughs) because the concept of "DateTime" record is just too ubiquitous (whether stored as "seconds since epoch" a distillation of an ISO format or just "[yy]yymmddHHMMSS[.###]" pseudo-value/string) and goes way back before Python (1991+) as you can find mentions of one kind or other in my old Ada (c1980) and Pascal (c1970) manuals/references. 172.70.162.206 15:47, 17 December 2023 (UTC)


The majority of libraries that provide time-calculation services call it something along the lines of DateTime. The reason you're getting Python results is because Python is currently the most popular programming language, especially for people learning to program. --172.71.150.154 19:51, 15 December 2023 (UTC)

The recently-added link for "hyperbolic" goes to a W'pedia page for "Hyperbolic motion (relativity)". This is obviously intended as a joke, but I'm not convinced that an unmarked joke like this is appropriate. BunsenH (talk) 16:04, 15 December 2023 (UTC)

I highly doubt this was meant as a joke, I'm quite convinced this was genuinely added to be helpful and fail to see how this COULD be a joke. ??? If it's not the correct concept it's too subtle to be a joke. NiceGuy1 (talk) 05:46, 17 December 2023 (UTC)
It quite definitely was a joke. I will take the badges of 'too subtle' and 'inappropriate' and wear them both with pride. ;o) 172.70.90.70 11:53, 3 January 2024 (UTC)

My first impression of the comic was that Randal was talking about romantic dates, and that participants may be too distracted to accurately recall when specific events occurred during them. These Are Not The Comments You Are Looking For (talk) 02:22, 17 December 2023 (UTC)