Skip to content
DevMeme
5716 of 7435
The Vatican: The Ultimate Authority on Date-Time Edge Cases
Databases Post #6269, on Sep 25, 2024 in TG

The Vatican: The Ultimate Authority on Date-Time Edge Cases

Why is this Databases meme funny?

Level 1: Counting from One

Imagine you’re sorting birthday cards into boxes, and each box can hold 100 cards. You start filling the first box with the 1st card, 2nd card, and so on. By the time the first box is full, you’ve placed cards number 1 through 100 in it, and you label that box “1” (because it’s the first box). The next box will hold cards 101 through 200, and you label that box “2” (second box). Now, if someone comes along and sees card #100 and thinks, “Hey, shouldn’t card 100 be in box 2 since 100 sounds like it’s part of the second hundred?” you’d explain, “Nope, the first box started at 1 and goes up to 100. The second box starts at 101.” In other words, you count the first group as 1, not 0.

That’s exactly what’s happening with years and centuries. The years 1 through 100 are called the 1st century, years 101 through 200 are the 2nd century, … fast forward, and years 1901 through 2000 are the 20th century. The next year, 2001, starts the 21st century. It feels a little like the counting is “off by one” because we’re so used to things starting at round numbers, but it’s just how the groups are defined.

The meme finds this funny because the technical manual basically throws up its hands and says, “Those are the rules. If you don’t like it, go talk to the person in charge of the rules!” — jokingly pointing to the Pope in the Vatican. It’s like if a kid complained about a school rule they thought was silly, and the teacher chuckled and said, “Well, if you want to change that, you’ll have to take it up with the principal who made the rule.” The humor comes from the exaggeration and surprise: you’d never expect a piece of software documentation to tell you to go argue with the Pope! It’s a funny way to say “this isn’t a mistake; it’s just the way the world decided to count things, so we have to live with it.”

Level 2: Where’s Century 0?

In simpler terms, this meme is about a quirk in how SQL (the language we use to talk to databases) handles dates – specifically how it figures out what “century” a date is in. The screenshot shows two queries using EXTRACT, which is an SQL function that pulls out a specific part of a date. For example, EXTRACT(YEAR FROM someDate) would give you the year, and similarly EXTRACT(CENTURY FROM someTimestamp) gives you the century number. In the example:

  • Asking for the century of December 16, 2000 gives 20.
  • Asking for the century of February 16, 2001 gives 21.

At first this might seem odd. Many people would think “2000 is in the 20th century? Isn’t anything in the 2000s the 21st century?” This is where the edge case comes in. It turns out the way we count centuries in the Gregorian calendar (the calendar system most of the world uses) is a bit unintuitive: the 1st century AD started with year 1 and went through year 100. There was no “0th century” and in fact no year 0 at all in our calendar’s year numbering. We went from 1 BC (which historians sometimes label year -1) straight to AD 1. So the 20th century actually covers 1901 up to 2000, and the 21st century begins at 2001. It’s a common point of confusion—remember all those debates about whether the new millennium started in 2000 or 2001? This is exactly that issue. The database is following the official definition: 2000 is the last year of the 20th century, so EXTRACT(CENTURY) returns 20. Only dates from 2001 onward return 21 for century.

For a new developer, this is a useful lesson in both history and programming: sometimes our software has to incorporate very old decisions about time and dates. An off-by-one error in programming usually means you’re one number off due to counting starting at 0 versus 1. In this case, if you expected 2000 to be “21”, you’ve effectively made that off-by-one mistake by assuming we count centuries from 0. The code is right – our expectation was off! The rule “no century 0” is built into the database’s date logic.

The funny part is how the documentation responds to anyone who might disagree. It basically says: “Hey, we didn’t make this rule. If you think the centuries should be counted differently, go complain to the Pope in Vatican City.” 😄 This line is tongue-in-cheek. Why the Pope? Because Pope Gregory XIII was the one who introduced the Gregorian calendar in 1582, and the century counting convention comes from how the AD calendar was historically set up (in fact, the idea of numbering years AD was established by a monk way back in 525 AD, and he didn’t include a year zero). By directing you to “write your complaint to the Pope, Cathedral Saint-Peter of Roma, Vatican,” the docs are joking that only the highest authority behind the calendar could change this, not your database programmers. It’s a playful way of saying “this isn’t a bug, it’s a feature inherited from history.” For any developer who’s struggled with date calculations, this bit of DatabaseHumor is a nod to how frustrating and absurd date-time rules can be. After all, if dealing with leap years, time zones, and daylight savings hasn’t driven you mad, discovering that centuries are counted oddly just might! But at least now you know: there’s a logical reason, and you’re not crazy – you just ran into a historical rule encoded in your SQL query.

Level 3: 1-Indexed Centuries

At first glance, this looks like a classic off-by-one error in an SQL date function. The query:

SELECT EXTRACT(CENTURY FROM TIMESTAMP '2000-12-16');  -- returns 20  
SELECT EXTRACT(CENTURY FROM TIMESTAMP '2001-02-16');  -- returns 21  

seems to suggest that 2000 belongs to century 20 while 2001 jumps to century 21. A junior dev might yell "Bug!", but any seasoned database engineer or tech historian will smirk – this is intentional. In the world of Databases and temporal DataFormats, centuries are counted in a 1-indexed way (there’s no century 0, just like there’s no year 0 in the Gregorian calendar). The first century AD spans year 1 up to year 100, the second century starts at 101, and so on. So by definition, the year 2000 is the last year of the 20th century, and 2001 kicks off the 21st. It’s a gregorian_calendar_edgecase baked right into SQL. The EXTRACT function isn’t wrong – it’s faithfully implementing the Gregorian calendar rules established long ago.

From a technical perspective, the EXTRACT(CENTURY ...) function likely uses a formula like:

century = FLOOR((year - 1) / 100) + 1  

This formula ensures year 1–100 → century 1, 101–200 → century 2, ..., 1901–2000 → century 20, 2001–2100 → century 21, etc. Notice the subtle year - 1 inside the math – that’s the crucial off-by-one adjustment. If a careless developer forgot that - 1, year 2000 would incorrectly end up in century 21. This is the kind of edge case that keeps database maintainers up at night, triple-checking their date math. It’s reminiscent of those pesky off_by_one bugs in array indexing (where forgetting that computers count from 0 leads to mistakes). Here, though, it’s not a bug at all – it’s by design according to calendar conventions.

The humor of the meme comes from how the documentation itself acknowledges this quirk with a wink. It explicitly notes “There is no century number 0, you go from -1 to 1.” Then it drops the punchline in the form of a mock support ticket escalation:

“If you disagree with this, please write your complaint to: Pope, Cathedral Saint-Peter of Roma, Vatican.”

In other words: “Don’t blame us (the software developers or PostgreSQL); blame history and the Pope who set up the calendar rules!” This is DatabaseHumor gold because it takes a mundane SQLQuery and connects it to a centuries-old authority. It’s not every day that reading SQL docs sends you straight to the Vatican’s complaint queue! Seasoned devs chuckle because they’ve seen plenty of bizarre bug reports and feature requests, but “file a bug with Pope Gregory XIII” is a new level of support escalation. The joke also riffs on the idea that some things in computing (especially in time/date handling) are out of our hands – they’re dictated by real-world standards or historical legacies. We often say “Time zones are hard”, but here even something as conceptually simple as the century has a gotcha. Many of us remember the public confusion around New Year 2000 vs 2001 (Was the new millennium starting or not?). This meme is basically the SQL documentation siding with the pedants who insisted the 21st century began on January 1, 2001. The extract_century_function is faithfully following the Gregorian definition. If that offends your intuition, well, take it up with a higher power (literally the Pope).

In summary, the meme blends DatabaseQuery logic with historical context. The real-world rule (“no year 0 in AD counting”) surfaces as an off_by_one_century effect in code. Instead of a dry technical note, the docs inject humor: throwing the problem over to the Vatican helpdesk. For veteran engineers, it’s a knowing laugh at how even the most rigorous systems (like a SQL date function) must bow to the weirdness of human history. And for the tech historians, it’s a delightful nod to how a decision made in the early medieval period still echoes in our modern software.

Description

A screenshot of a technical documentation page with a dark background explaining how centuries are calculated in SQL. The page displays two SQL queries: `SELECT EXTRACT(CENTURY FROM TIMESTAMP '2000-12-16')` which results in `20`, and `SELECT EXTRACT(CENTURY FROM TIMESTAMP '2001-02-16')` which results in `21`. Below the queries, text explains that the first century began on 0001-01-01, there is no century zero, and this standard applies to all Gregorian calendar countries. The punchline, highlighted with a red box, humorously states, "If you disagree with this, please write your complaint to: Pope, Cathedral Saint-Peter of Roma, Vatican." This meme targets the classic developer frustration with pedantic, non-intuitive standards, in this case, the off-by-one error in century calculations. The joke is that the definition is not a mere technical convention but an unchangeable historical decree, with the ultimate authority being the Pope who instituted the Gregorian calendar

Comments

21
Anonymous ★ Top Pick Your code might be ISO 8601 compliant, but is it Papal Bull compliant? That's the real legacy system we're all maintaining
  1. Anonymous ★ Top Pick

    Your code might be ISO 8601 compliant, but is it Papal Bull compliant? That's the real legacy system we're all maintaining

  2. Anonymous

    Yet another reminder that temporal edge cases aren’t bugs - they’re canon law

  3. Anonymous

    After 20 years of explaining why array indices start at 0 but centuries start at 1, I've finally found the perfect escalation path for date-time complaints: straight to the Vatican. At least it's more responsive than the ISO 8601 committee

  4. Anonymous

    Ah yes, the EXTRACT(CENTURY) function - where your database becomes a pedantic historian insisting there's no year zero. It's the perfect reminder that while we've solved distributed consensus and can run Kubernetes at scale, we still can't agree on when centuries start. At least the documentation helpfully redirects all theological disputes to the Vatican's complaint department, which presumably has a longer SLA than your average Jira ticket

  5. Anonymous

    Postgres EXTRACT(CENTURY): Mathematically precise, historically orthodox - Vatican complaints not included

  6. Anonymous

    EXTRACT(CENTURY) is the only feature with an escalation path above the CTO - if your business insists 2000 is the 21st, file the ticket with Rome

  7. Anonymous

    Postgres reminds us that date math isn’t broken - it’s just faithfully implementing a 1582-era API; if you want a zero-based century, open a ticket with the Vatican maintainer

  8. @Agent1378 1y

    Yes. Millenium celebration in 01.01.2000 all over the globe was amazing stupidity

  9. @Johnny_bit 1y

    Given current pope... Please do not write complain to the pope because we'll have the century 0 and everybody will have to patch their date handling as if that wasn't complicated enough.

    1. @trainzman 1y

      Not even that, but we'll have to endure through 2024 again

      1. @azizhakberdiev 1y

        dafuq

        1. @trainzman 1y

          True, i misread the post a bit

    2. @azizhakberdiev 1y

      I'm not catholic, but now I'm curious what kind of pope is Francis now. Is he that modern thinking?

  10. @ZgGPuo8dZef58K6hxxGVj3Z2 1y

    How convenient that calendars are based on religion not science

    1. @Johnny_bit 1y

      Same thing really (if you go back far enough)

      1. @ZgGPuo8dZef58K6hxxGVj3Z2 1y

        Always has been💀

  11. @azizhakberdiev 1y

    Nerding time: It is not century 21 or year 2024, it is 21st century and 2024th year, so there's technically cannot be 0th century of year Whoever thought that centuries turn at 00th years are wrong. However I dont remember a rule about millenia being turn of 10th century or just appearance of 000th year on calendar

    1. @ZgGPuo8dZef58K6hxxGVj3Z2 1y

      There is worse... ten days were dropped from October 1582 and the day after 4 October 1582 was declared to be 15 October and the pope calculated 13 days missing instead of 10. Which means there are kinda 300 years missing or misdocumented. There is evidence in other religions that our chronications have 300 years missing at some point.

      1. @azizhakberdiev 1y

        Isn't that issue of leap years? There were multiple adjustments to calendar system because of lack of accuracy in the past

        1. @ZgGPuo8dZef58K6hxxGVj3Z2 1y

          Yes the 10/13 days were

  12. @loki8008135 1y

    Source https://www.postgresql.org/docs/8.1/functions-datetime.html

Use J and K for navigation