Live data from Hacker News

Dates That Don't Exist (2015)

blog.yossarian.net

51–60 of 90 posts

Re: Dates That Don't Exist (2015)

#51

This is clearly the wrong way to think about it. Dates forward and backward from this flag date exist in both calendars and it's straightforward to convert between them. Such a flag day didn't involve removing days from one calendar or the other, it switched between them.

It's not a wrong way to think about it. There are some use cases for proleptic calendars, but there are just as many where it's completely inappropriate. If you ever need to compare what day you think it is with what day someone in the past thought it was, then yes those dates don't exist in any real sense. I wouldn't say it's it's straightforward to convert between them, either. The Gregorian calendar was first adop…

I would say it's almost never appropriate unless you're directly quoting source texts.

If you are talking about a historical event from Egypt in 500 BCE, you would say "this happened in 500 BCE", not "this happened in year 26 of the 27th dynasty".

The distinction is important in the context of doing historical research, but it is no more appropriate to write dates in secondary sources using the Julian calendar than it would be to try to explain Egyptian history by spouting hieroglyphics at people.

Re: Dates That Don't Exist (2015)

#52

There seems to be disagreement about the year. Two systems I checked assume 1752, not 1582. (OpenBSD) $ man cal [...] The Gregorian Reformation is assumed to have occurred in 1752 after the 2nd of September. By this time, most countries had recognized the Reformation (although a few did not recognize it until the early 1900s). Eleven days following that date were eliminated by the Reformation, so the calendar for tha…

It depends on the country.

1582 is Catholic Europe

1700 or 1701 is Protestant Europe

1752 is Great Britain and its colonies which include USA

1918 is Russia

1923 Greece

https://en.wikipedia.org/wiki/Adoption_of_the_Gregorian_cale...

Re: Dates That Don't Exist (2015)

#53

There seems to be disagreement about the year. Two systems I checked assume 1752, not 1582. (OpenBSD) $ man cal [...] The Gregorian Reformation is assumed to have occurred in 1752 after the 2nd of September. By this time, most countries had recognized the Reformation (although a few did not recognize it until the early 1900s). Eleven days following that date were eliminated by the Reformation, so the calendar for tha…

agreed

Re: Dates That Don't Exist (2015)

#54

> In essence, then, those ten days in 1582 never happened and simply do not exist within the Gregorian calendar system used almost universally in the West today. I find these things so much easier to think about if you consider the change as a change from one calendar system to another calendar system. Those 10 days certainly exist, in both calendar systems, they just represent different points in time. I.e., I think…

> Those 10 days certainly exist, in both calendar systems.

Not in the standard Gregorian calendar. Those dates only exist in the proleptic Gregorian calendar. The standard Gregorian calendar explicitly skips them. That's because you can't feasibly go back and change all the Julian dates that had been physically written down for centuries. That's why it's called the Gregorian "shift".

Re: Dates That Don't Exist (2015)

#55
This whole story is built on one wrong assumption: that there are some clear rules defining calendar shifts. As the author discovers at the end this history differs in different countries, and what dates exist is not anymore easy to tell universally. But now let's recall countries are not the same anymore, so even ncal's admirably nerdy attempt to be precise is just a rough approximation. Then how about a Catholic town in a Protestant country, or vice versa? How about people using several calendars simultaneously for different purposes? The truth is there's no clear recipe for every case, and for ≈99.9999% cases proleptic Gregorian (which doesn't care) is completely fine.

Re: Dates That Don't Exist (2015)

#56
post #48
post #44

Earlier quoted context omitted.

Most applications don't have to worry about it, but platforms do. The SQL standard requires accurate date representation for years 0000-9999. I was surprised to learn about the Gregorian shift while testing our database system. I also learned about "war time" in WW2 and the "battle of the clocks" in colonial India. A lot of history came out of debugging those tests.

For sure. I was thinking more of "normal" applications, as opposed to things like SQL databases. It looks like the SQL standard explicitly calls for the use of the Gregorian calendar for dates, so I think that answers the previous question of "Who else uses the proleptic Gregorian calendar other than programmers of datetime libraries?"

"normal applications", no. But there are more platforms besides databases, e.g. programming languages. Any platform that works with dates will have to deal with these weird quirks. And application that works with dates probably would not, although there's always leap seconds...

Re: Dates That Don't Exist (2015)

#57
post #41

Earlier quoted context omitted.

Who else uses the proleptic Gregorian calendar other than programmers of datetime libraries?

Who writes computer programs that deal with pre-1582 _dates_ at all? In science-related code, I can image a case for calculating things like seconds elapsed across a very long time period. But in that case you're not really dealing with dates. Instead, you want something like the Unix epoch, but probably with an earlier epoch start. There may be some very niche cases for pre-1582 dates in code that I'm not thinking o…

This point about using seconds is entirely correct, and date-time should always be in epoch timestamp (numeric) except for human interfaces (input or rendering for output). APIs and web-forms should never pass multipart date strings because they can be internally inconsistent, for example February 30. (edit: unless there's no sequential meaning in the date and the date is just a local day name without the notion that adding or subtracting 1 takes you to yesterday or tomorrow (https://gist.github.com/timvisee/fcda9bbdff88d45cc9061606b4b...)).

(p.s. autarch thanks for your efforts in open source).

Re: Dates That Don't Exist (2015)

#58
Dealing with dates becomes much simpler conceptually when you realize that you are actually dealing with two different ideas masquerading as one: dates, and the actual instants in time which they name. Instants in time can only be unambiguously referenced by measuring some fixed unit of time intervals from some commonly agreed upon event (e.g. seconds since the Unix Epoch).

Dates are a mapping from human-readable labels to instants in time; critically, this mapping is not a total function (there are dates that map to no instant in time in a particular calendar, such as October 5-14 1582 in the Gregorian calendar, or 2:30am March 8 2026 in US timezones due to DST), nor is it in fact a function at all depending on how you define your inputs (1:30am November 1 2026 in US timezones is ambiguous if you don't specify DST/ST).

Furthermore, the mappings (both for past dates and future dates!) can themselves change over time (changes to DST, timezones, and calendars such as in TFA), and you need to keep track of these changes in perpetuity, as well as at which instant in time they were implemented, and we don't necessarily have that information for some of these historical changes, we only have the date as written down, which itself can suffer from the ambiguity problem (is it the date pre- or post- calendar change?).

This makes dealing with past dates tricky, and dealing with future dates speculative at best. For instance, what's February 28th + 1 day? The answer depends on the calendar system and the year; we can answer it definitively for past years but not necessarily for future years (maybe in 2040 we'll move the leap day to December 32nd). This is why it's important to immediately convert past dates (and sometimes future dates, depending on the use case) to unambiguous instants in time, and only convert them back to dates for display purposes.

"Wednesday, August 12th 2026" and "8 days from now" are also semantically distinct for some purposes: if have 8 doses of a daily prescription left, I'm still going to run out in 8 days even if tomorrow the government decides to repeal the Gregorian calendar, thus changing the name of "8 days from now" from "Wednesday, August 12th 2026" to "Sunday, August 2nd 2026". My medication doesn't care what the government decides to call 8 days from now, I'm going to run out either way. The pharmacy, on the other hand, very much does care what the government decides to call 8 days from now, because perhaps they're closed on Sundays. The calendar change means that "8 days from now" went from being not-a-Sunday to a Sunday, affecting their operating hours.

It's really just another instance of one of the two hard problems in computer science: naming things.

Re: Dates That Don't Exist (2015)

#59

Earlier quoted context omitted.

If a contract dated to the 4th October 1582 specifies you have 15 days to make payment, you would indeed need to know where that contract was signed to determine on what day that deadline expired. And if there is a contract dated to the 6th October 1582, that does raise questions about its legitimacy (though in general misdating a contract does not void it, it would merely be one point of evidence in your argument th…

I assume there is a way to handle this in modern contract law. Surely people have forgotten how long the various months are and written contracts referring to April 31.

It's one of the reasons that they spell it out, or do things like "define what month is, and then the payment is due X months out" and not on a specific date.

Re: Dates That Don't Exist (2015)

#60
post #41

Earlier quoted context omitted.

Who else uses the proleptic Gregorian calendar other than programmers of datetime libraries?

Who writes computer programs that deal with pre-1582 _dates_ at all? In science-related code, I can image a case for calculating things like seconds elapsed across a very long time period. But in that case you're not really dealing with dates. Instead, you want something like the Unix epoch, but probably with an earlier epoch start. There may be some very niche cases for pre-1582 dates in code that I'm not thinking o…

Genealogy apps, e.g. Ancestry.com
Post reply on HN