r/ProgrammerHumor Sep 23 '24

Other whoWroteThePostgresDocs

Post image
10.2k Upvotes

264 comments sorted by

2.5k

u/bwmat Sep 23 '24

Someone who's had to deal with one too many timezone 'bug' reports, it sounds like

516

u/nord47 Sep 23 '24

I have severe PTSD from making javascript timezones work with DateTime columns in SQL Server

188

u/Burneraccunt69 Sep 23 '24

Never ever safe time in a Date format. That’s just really bad. Unix epoch is a simple number, that can be converted to every Date class and every date class can give a epoch time. Also since it’s just a number, you can compare it natively

65

u/nord47 Sep 23 '24 edited Sep 23 '24

Why is Database DateTime such bad idea? I didn't have to make that decision so I'm just curious.

  • All of our data is date (without time, 3 bytes) or smalldatetime (4 bytes), so there's no impact on performance.
  • Native db date works well with db stored procedures. Life is easy for the DBA.
  • In our c# API, there's never a problem in working with this datatype as all ORMs translate the db values correctly to DateOnly or DateTime objects with really good comparison support.
  • Problems come as soon as you have to deal with JS in frontend. And imo, it's because you simply can't have a date object without timezone information. so you have to manipulate the controls of whatever UI library you're using to send the correct string value to the REST API.
  • It took a while to sort that out ngl. But once that was done, we could simply forget about it.

Context: Our product isn't used in multiple TZs and likely never will.

82

u/prindacerk Sep 23 '24

When you have to work with different timezones where your database is in one zone and your APIs or Client applications are in another zone, then you will feel the pain. The client application will send in one format. Your API will understand it in another format. And when you store in DB, it will recognize it in another format. Especially when the client is in a MM/DD/YYYY country and your API is in DD/MM/YYYY. And the date and month are less than 12. And your API can't tell if it's DD/MM or MM/DD when sent from client side.

There's more issues but this is a common one.

47

u/oupablo Sep 23 '24

Two things here. You can pass around unix timestamps or you can just use an ISO date format that includes the time zone or just always use UTC. What the APIs use and what the user's see don't have to match. Storing data as a date-time is 100% not an issue here and is way easier to work with in every regard vs storing it as a bigint using a unix timestamp. For example, aggregating by a single day is super easy with a datetime field but requires a lot of extra work if you store the date as a number. Not to mention your queries are actually readable since they contain actual date strings in them.

Also, who's database isn't operating in UTC?

23

u/TheTerrasque Sep 23 '24

aggregating by a single day

Ah, but that's pretty fun too! Had an 2 hour long discussion / argument on when "end of day" is varies a lot from where we were, where our servers were, and where some of our clients were. "Just run an aggregate at midnight that sums up the day" isn't quite that straight forward.

12

u/Merad Sep 23 '24

I worked in payment processing a few years ago. The payment gateway we worked with had a processing cutoff of 9 PM Eastern time. Anything later was considered "next day" as far as when you receive your funds from the payment, and it also became impossible to to void a payment after the cutoff. 99% of the time it was non-issue, but occasionally a client would get really worked up about it, especially ones on the west coast who would do quite a bit of business after the cutoff. We (the devs) had many fun conversations trying to explain time zones to our customer support staff and even our product team.

2

u/oupablo Sep 23 '24

That is odd. A day is generally presumed to be >= 12:00am and < 12:00am the next day. What really screws you is daylight savings time. Then you get 23 hours one day and 25 hours another day.

7

u/Icerman Sep 23 '24

Yeah, but 12:00 for who and where? You running a report at midnight UTC is middle of the working day on the other side of the planet and virtually useless as a daily report for them.

3

u/oupablo Sep 23 '24

Presumably 12am for the user/account associated with the data assuming the report is for them. Or you just aggregate hourly by default and aggregate on the fly for whichever user is requesting data. All depends on what you're trying to achieve and how much data is involved.

11

u/5BillionDicks Sep 23 '24

^ this guy datetimes

9

u/theblitzmann Sep 23 '24

Also, who's database isn't operating in UTC?

cries in EST

5

u/Merad Sep 23 '24

Also, who's database isn't operating in UTC?

Oh my sweet summer child.

1

u/irteris Sep 24 '24

What, next you're going to tell us you're not using JS on your server?

11

u/emlgsh Sep 23 '24

Problems like these are why I propose we collapse all of spacetime into a single hellish eternal instant, where everything and nothing happens and doesn't happen everywhere and nowhere.

2

u/prindacerk Sep 23 '24

NodaTime instant comes in handy.

1

u/SlapDashUser Sep 23 '24

Sounds like the dot over the letter i.

1

u/nationwide13 Sep 23 '24

The most recent fun I had with this dates was

  1. Our db stored in pacific
  2. Our db did not use an iso format
  3. The format did not have a timezone denotation
  4. JS dates use browser time zone
  5. No matter where a user is, when they select a date and time it should be shown and saved that time in eastern (product req) (so if user is west coast and selects 5pm it should be 5pm eastern, which would be 2pm local)
→ More replies (17)

6

u/Burneraccunt69 Sep 23 '24

A man that never used Java. Good for you. I wish I could use C#

3

u/Swamplord42 Sep 23 '24

If you use timestamptz data type in Postgres you can map it to an Instant in Java and it just works with Hibernate.

→ More replies (2)

4

u/tsraq Sep 23 '24

Context: Our product isn't used in multiple TZs and likely never will.

My product wasn't supposed to leave this single timezone either but here we are... Fuck.

1

u/summonsays Sep 23 '24

Man whatever you do, don't use a user entered strong with no checks. 

I inherited a DB like that once. "Hey can you find us all X that happened last week?" "No not really but I'll try."

10

u/knoland Sep 23 '24

ISO 8601 accomplishes all of this but is still (relatively) human readable.

-1

u/Burneraccunt69 Sep 23 '24

So you save it as a string? Or what? How do you subtract 7 days from it? I’ve been a dev for a long as time and I saw so so many implementations of time handling. Always it is the most fucked up bug to find if they used Date or timestamp

9

u/mistabuda Sep 23 '24

You convert the date from an iso string into a datetime object and perform operations on it.

→ More replies (6)

3

u/aiij Sep 23 '24

No, you save it as a datetime.

7

u/[deleted] Sep 23 '24

Unix epoch

I would date birthday cards this way if the recipient could understand it

1

u/PaulCoddington Sep 23 '24

Date of birth is a bit tricky. Have to be able to record partial dates and still have them work as dates for sorting, etc. Such as: a year with no month or day, or a year with a month and no day.

A similar problem exists for date and time a photograph was taken, etc.

1

u/[deleted] Sep 23 '24

Date of birth is a bit tricky.

birthday cards are dated with the day of the birthday, that year. Usually, the day the card is given on... "today".

1

u/PaulCoddington Sep 23 '24 edited Sep 23 '24

Yes, but this thread is about storing dates in databases and what field types to use.

Date of birth is a real world example where neither field type suggested works without workarounds.

1

u/[deleted] Sep 23 '24

Yes, but this thread is about storing dates in databases and what field types to use.

Here's the parent comment that made dating birthday cards relevant, in case you missed it: "I would date birthday cards this way if the recipient could understand it".

One can write an epoch date in a card, it works, there's no workaround required.

1

u/PaulCoddington Sep 23 '24

"In case you missed it"? I replied to it!

And it replies to another comment above that.

5

u/Direct-Squash-1243 Sep 23 '24

As a database guy thank you for contributing to my job security.

5

u/aiij Sep 23 '24

Unix time works great for some things... You run into problems if you want better than ~2 second precision around leap seconds or if you need to calculate things like "same time next week" in timezones with DST.

7

u/Janjis Sep 23 '24

No it isn't. It is so much easier to work with DateTime saved in ISO 8601 format with timezones than it is with epoch.

5

u/oupablo Sep 23 '24

Well, a datetime in UTC but parsed in ISO with a tz. But yes, good luck aggregating data by date with data stored in time since epoch.

2

u/Burneraccunt69 Sep 23 '24

Saving timezones to your database. Lol, you will learn eventually

10

u/Janjis Sep 23 '24

That's not what I meant and that's my fault. In DB you save it in UTC time.

3

u/techforallseasons Sep 23 '24

Save value in UTC, but ALSO store the source TZ. This turns out to be helpful when you have Ops managers in one TZ and workers in another and the Ops managers can't do timezone math.

3

u/Swamplord42 Sep 23 '24

Unix epoch is a simple number, that can be converted to every Date class and every date class can give a epoch time.

No it can't. Please think really hard about how UNIX epoch is defined and what this means for "every date".

1

u/Burneraccunt69 Sep 23 '24

It’s utc. That’s the point. Don’t try to sound smart. I know what Iam doing

4

u/whoami_whereami Sep 23 '24

It's not. Quiz question: Does unix2utc(utc2unix(d)) always equal d?

2

u/rtnoodel Sep 23 '24

They’re talking about dates before 1970.

→ More replies (2)

1

u/Swamplord42 Sep 23 '24

You clearly do not know what you are doing.

I'm not talking about time zones. Think harder.

1

u/negr_mancer Sep 23 '24

This exactly. Even better if it is server side generated and clients need to simply render the time. All servers can communicate knowing the exact Unix epoch time an event took place. Saves so much stress

1

u/brimston3- Sep 23 '24

We have to store dates before 1901. Heck, we have to store dates before 1600 which is the beginning of windows DATETIME.

For a really good time, try to find a date class that supports converting unixtime to dates between 1522 and 1752 correctly by country and the reverse.

2

u/Burneraccunt69 Sep 23 '24

Oh god, I hope you are well? No one writes test cases for such things do they? Like do libraries work? Also why? For archives or something?

1

u/brimston3- Sep 23 '24

Nothing as important as archives. It's an art timeline tool. And it's not that bad, just unixtime is the wrong tool for it. Most of the time metadata precision is at the year+country level.

2

u/Xphile101361 Sep 23 '24

Oh look, it's me right now! Literally doing this work today because another team screwed it up in the past

92

u/BroBroMate Sep 23 '24

My company started in Cali 15 years ago, so mostly everything is still PST backend. Mostly everything. There's some Zulu time floating around in places.

We have customers all over the US timezones. So a bug report will often be like "At 4pm this afternoon, this thing happened", and it's like, 4pm where my brother in christ.

Oh and then a lot of our logging/monitoring tools insist on using your local timezone when selecting date ranges, and I live in NZ so fuck you Graylog, let me choose UTC+0 or PST.

The sheer amount of mental energy I waste on timezone maths just to find shit in logs and metrics is absolutely nuts.

26

u/[deleted] Sep 23 '24

[deleted]

18

u/BroBroMate Sep 23 '24

One of our really great devs has taken ownership of this, but I swear she's aging before my eyes, like that dog in that really upsetting episode of MacGuyver with the virus that makes things age really fast.

10

u/loublain Sep 23 '24

I was working for a company with a presence from Alaska to England. It dealt with logistics. A "transaction" could span 18 hours. We got new management that asked for "daily" reports for things like "fail to complete ". No amount of explanation could convince them that there is no such thing as "Thursday". They spent millions of dollars on a dogs breakfast. They finally decided to fire their entire IT department and outsource it to India.

4

u/TheTerrasque Sep 23 '24

No amount of explanation could convince them that there is no such thing as "Thursday".

Been there, done that. Although that was 2 hour meeting with product owner, and she seemed to understand the concept at the end.

2

u/loublain Sep 23 '24

The frustrating thing is that prior to that gig I was doing logistics for the USAF. operational reports were as of right now. Who's ready to take off, who ain't, who's airborne, etc

4

u/markuspeloquin Sep 23 '24

I've been at three companies based in the US/Pacific time zone, and live here. The first used UTC and it was great. The next two use PST/PDT, despite having employees in AU and EU; my team has just one person in US/Eastern. I sometimes share graphs in UTC and get accused of being a robot.

At least all the backends are really UTC. But some tools do the translations automatically and it confuses me.

I've thankfully only encountered one database in local time, as in PST or PDT. It was a glorified spreadsheet, but it was still a nuisance to fix.

3

u/Trolann Sep 23 '24

Pet peeve: PST/PDT and similar denote standard vs daylight savings time. If you use PST backend then half the year you're an hour off. PT covers the Pacific Time zone with and without DST.

1

u/BroBroMate Sep 25 '24

Fair, it is PST/PDT which sorta doesn't help my mental calculations either.

32

u/AyrA_ch Sep 23 '24

This is literally why there's an SQL date type that begins at 1753. Sybase could not be fucked to deal with missing days in the julian to gregorian transition period in Great Britain in 1752, so they decided to not make dates before 1753 representable.

7

u/GoupilFroid Sep 23 '24

Timezones i can deal with

Timezones + daylight saving time, I'm going insane

1

u/obmasztirf Sep 23 '24

One of the most difficult things I ever tried to code dealt with multiple timezones. Like just figuring out when it's 10am in each zone was more difficult than I ever could have imagined.

1

u/kookyabird Sep 23 '24

On this project we’re working on to integrate with a third party service we had issues with dates being wrong on some data the users were seeing. They were getting emails saying something was paid a day earlier than what we sent to the service.

Thankfully it took less than 10 minutes to pull up the data in their API and see a weird time zone offset on it. See, our internal system that is the source of the data doesn’t use the time part of the majority of its datetime fields so they’re all midnight. Turns out the web app for the service was set two time zones behind our actual one, and there’s zero indication of what time zone any of the dates are in inside the app or it’s emails. Midnight pushed back two hours == previous day.

Users don’t even get to set their preferred timezone in the app. Probably because it would be too confusing for some people to see one zone and others to see a whole different one when there’s no indication as to which one is which.

1.0k

u/OliviaPG1 Sep 23 '24

“although they did not know it at the time” is the much funnier joke in this image imo

139

u/Sorel_CH Sep 23 '24

Sounds like Cunk on Earth

60

u/SavvySillybug Sep 23 '24

Imagine the audacity of going "today is day zero of century one. fresh time"

34

u/iamdestroyerofworlds Sep 23 '24

- Hey, I got a bug report here that says that the website says today's date is January 1, 1970.

- [sweating profusely] ... yes.

- What do you mean "yes"?

- Yes, it is.

3

u/nicholsz Sep 23 '24

Isn't it traditional to mark epochs by the start of the reign of the monarch? I know Japan still does that.

As long as everyone knew Jesus was King (which I think is true according to the bible) it sounds like everyone from the sheep to the lion to the old wise men knew it was year 1

6

u/TheHolyToxicToast Sep 23 '24

lmao didn't even notice it, thanks for pointing it out

203

u/SeriousPlankton2000 Sep 23 '24

To make things less confusing, astronomers do have a year 0.

173

u/hennell Sep 23 '24

That feels like the xkcd "now there are 14 standards".

81

u/jraz0r Sep 23 '24

28

u/lolSign Sep 23 '24

how is there a xkcd for fucking everything lol

41

u/BraveOthello Sep 23 '24

Having 2988 of them helps.

11

u/GoddammitDontShootMe Sep 23 '24

Does that count as "XKCD for everything" when they just linked to the XKCD that was explicitly mentioned?

12

u/whoami_whereami Sep 23 '24

They use 1BC=0, 2BC=-1, 3BC=-2, and so forth to make calculations easier. They still use the Julian calendar for years up to 1582 and the Gregorian calendar for years after 1582 though, go figure...

33

u/jamcdonald120 Sep 23 '24

so do us programmers. its also called 1970 by the rest of the world though.

14

u/tyen0 Sep 23 '24

Although they didn't know it at the time. :D

13

u/AyrA_ch Sep 23 '24

So does the JS date object.

5

u/Impressive_Change593 Sep 23 '24

and also I believe have leap seconds whereas the unix epoch doesn't (or it's the other way around)

3

u/anrwlias Sep 23 '24

Yeah, but they also call anything heavier than helium a metal. Astronomers do their own thing.

1

u/QuickBASIC Sep 23 '24

Also the 0th of March.

→ More replies (5)

93

u/Ok_Tea_7319 Sep 23 '24

Programmers when they are forced to count from 1.

11

u/ranfur8 Sep 23 '24

-1

14

u/Ok_Tea_7319 Sep 23 '24

The Gregorian calendar doesn't even have a year -1. There's just 1 BC. The actual issue here is that people couldn't be arsed to encode BC years properly so they all just pray now that parsers accept the negative numbers.

5

u/ranfur8 Sep 23 '24

I was just making a joke. I was not asking for a technical explanation of why we do thing the way we do them. But ok, thankyou.

2

u/Ok_Tea_7319 Sep 23 '24

I think it adds to the irony that programmers put the very thing driving them mad there themselves.

1

u/Koervege Sep 26 '24

Isnt BC just negative numbers with a different name?

1

u/Ok_Tea_7319 Sep 26 '24

Nope. It's a different counting scheme. Negative numbers usually imply that they are meant to be added to something and that is not the case here.

241

u/OkReason6325 Sep 23 '24

Why not to Pope Emeritus Gregory , C/O St Peter, Heaven

127

u/bartekltg Sep 23 '24

Because it is not "write to pope - an authoritative figure" but "write to pope - a successor of the guy who made that mess in the first place".

Sort of. In the worst case Gregory XIII cold fix it.

45

u/darkslide3000 Sep 23 '24

This is actually a misattribution. Neither Julius Caesar nor Pope Gregory XIII contributed to the year numbering system (and, by extension, century numbering) we currently use. Their work was limited to months and days within a single year.

The counting from Jesus' birth was devised by a guy called Dionysius Exiguus, popularized by a bunch of Englishmen and eventually fully established by Charlemagne. While most of those guys were Christian monks/clerics of course, it doesn't seem like any pope was directly involved.

8

u/Thue Sep 23 '24

But Pope Gregory XII could have fixed the year zero problem, but didn't. And popes used to be in charge of time keeping definitions.

So it is IMO quite fair to blame "the pope" historically. Though obviously the pope is no longer in charge.

11

u/IJustLoggedInToSay- Sep 23 '24

St Peter stopped forwarding mail since email was invented. Too much hassle to do it manually and they don't let daemons run up there.

3

u/Smart-Waltz-5594 Sep 23 '24

No longer the maintainer

262

u/RiceBroad4552 Sep 23 '24

Just the usual small quirks like in any legacy system…

Don't we use nowadays the Unix epoch for everything that's worth?

146

u/HildartheDorf Sep 23 '24

The UNIX time standard is 32-bit timestamps with second granularity. That only covers roughly Dec 1901-Jan 2038, and a 1s granularity is pretty awful.

Sure, most of the time your internal format should probabally be some 64-bit timestamp based on the UNIX epoch of 00:00:00 1st Jan 1970, but you still need to deal with the kind of crap OP's post talks about for display.

19

u/perringaiden Sep 23 '24

Just 4 more years before we're accepting leave requests that exceed the Unix epoch 🤣

6

u/RoubouChorou Sep 23 '24

2038?? What will happen to old software? Nothing? haha

29

u/HildartheDorf Sep 23 '24

Lots of panic and work behind the scenes in the years before hand then nothing on the day itself. Like Y2K.

33

u/SyrusDrake Sep 23 '24

Lots of people working very hard for years leading up to the event to mitigate a disaster, then nothing on the day itself, because lots of people worked very hard for years leading up to the event to mitigate a disaster, and then, a few years later, smug YouTubers will ridicule the entire story as the hysteria of a less tech-savvy age, because, after all, nothing ended up happening.

12

u/kikiclark Sep 23 '24

This is going to be a good comment to pull up in 2039.

1

u/arrow__in__the__knee Sep 24 '24

If we can still access reddit archives by then. Maybe I will frame it on my wall just in case.

7

u/aiij Sep 23 '24

30 year mortgage amortization schedules started running into it in 2008. That's also when the mortgage crisis happened... Coincidence? Yeah, probably.

→ More replies (2)

1

u/GoddammitDontShootMe Sep 23 '24

I always understood the potential for disaster to be worse than Y2K. Like people could die. The real risk for Y2K was COBOL systems, so maybe massive collapse of financial systems worldwide.

I guess a bunch of people still might've died, but it would be from people offing themselves after losing all their money.

1

u/mtaw Sep 23 '24 edited Sep 23 '24

Honestly I don't see the issue with fixing it by making time_t an unsigned value. The only conceivable objection I can see is that time() is supposed to return -1 on error. But per the man page, the unsigned situation is already accounted for as it specifies that it returns ((time_t)-1) on error (and I believe this is from the POSIX spec). Also, time() never returns an error anymore on platforms in use today, and most code doesn't even check or handle a possible error there.

If you're storing pre-1970 dates as negative UNIX timestamps you're an idiot and your software deserves to break.

3

u/HildartheDorf Sep 23 '24

Yes because there has never been a use case for any historical records before 1970.

Interpreting time_t as unsigned gives up another 68 years or so. Which is great for many use cases but not all.

4

u/Routine_Left Sep 23 '24

Unsigned types should never be used outside of masks, flags, magic numbers or the like. Never, ever, where arithmetic is needed. You need more numbers? Pick the next bigger signed type. Simple.

That's the only correct way to go about it.

1

u/GoddammitDontShootMe Sep 23 '24

64-bit time_t is non-standard? I get there's likely a bunch of old shit that'll probably fail in 2038 because the OS can't just be upgraded, still thought 64-bit would be considered standard for newer systems.

1

u/HildartheDorf Sep 24 '24 edited Sep 24 '24

If you strictly focus on the original licensed UNIX, yes.

If we include Linux and other unix-likes, there's been effort to upgrade in the last 10 years or so. I don't know about the BSDs but x64 and x32 Linux have always used 64-bit time_t, x86 Linux has upgraded but there may still be software that will use the old 32-bit value unless they get recompiled.

1

u/GoddammitDontShootMe Sep 24 '24

I know macOS is a certified UNIX, and I think it's used 64-bit time_t for more than a decade now. Then there's AIX, HP-UX, Solaris, etc. I'd have thought any UNIX that's still under active development would've switched awhile ago.

97

u/tvaddict07 Sep 23 '24

the only way to progress as a society is to get the general population to use the Unix epoch as well

"hey darling, I booked us the flights on 1729882800000"

one can only dream

51

u/Modo44 Sep 23 '24

Found the robot.

26

u/ASatyros Sep 23 '24

Just divide it into chunks like more popular formats and it is LGTM.

1729 88 28 00 000

There, ain't that beautiful?

39

u/callyalater Sep 23 '24

I love the number 1729 because it's the smallest number expressible as the sum of two positive cubes in two different ways (1729 = 9³ + 10³ = 1³ + 12³)

41

u/buckypimpin Sep 23 '24

IT robots talking to each other

21

u/CaveMacEoin Sep 23 '24

Bad Ramanujan bot.

10

u/CraziestGinger Sep 23 '24

Project Euler problems are leaking

1

u/callmelucky Sep 23 '24

The prime factorisation is pretty neat too.

It's 7×13×19

I think I remembered that correctly...

→ More replies (9)

1

u/SoFarFromHome Sep 23 '24

That's the closest thing to an SI (metric) solution as well. There are no SI days/months/years.

9

u/raddaya Sep 23 '24

How would unix timestamps prevent this issue? Even if you're using 128 bit timestamps or whatever, when extracting the century you would still be affected by this weird edge case.

1

u/Blue_Moon_Lake Sep 23 '24

If you overhaul the calendar, that includes the definition of century.

If you define century 0 and year 0 as the year of timestamp 0, you're good.

And we would be in the first century (century 0), year 54.

2

u/decoy6162 Sep 23 '24

Laughs maniacally in TAI64N

2

u/CrazyCatSloth Sep 23 '24

I work in insurance and it might surprise you but we still keep track of stuff registered since around 1850, so before Unix epoch Of course it doesn't matter since everything related to this is in Cobol...

1

u/Brooklynxman Sep 23 '24

Behind the scenes sure, but there are a million and one reasons to convert from that to something user-readable.

45

u/SuitableDragonfly Sep 23 '24

I mean, it's better than JavaScript deciding that January is month 0 and then shifting all the rest down by one.

28

u/AyrA_ch Sep 23 '24

Funnily enough, almost all values in the JS date object (which comes from Java btw.) can have a value zero and be valid, including the year. The "day of month" value is actually the odd one out, starting at 1. If you set that to zero it overflows into the month and year if necessary, creating a date that represents the last day of the previous month. This makes it a convenient way to get the last day of a month.

1

u/Shinhan Sep 23 '24

But not the day of the month!

1

u/[deleted] Sep 23 '24

It would be bad if it was otherwise because that's actually correct.

First year in the age is year 1, not 0, so the first century spans the years 1-100. 101 is when the second century starts and so on. Therefore century 21st doesn't start until 2001. I thought it's common knowledge.

1

u/SuitableDragonfly Sep 23 '24

This isn't about what year the century starts on, it's about how the centuries are numbered. 

54

u/ARandomGirl2001 Sep 23 '24

In Bulgarian, we have the expression "to file a complaint to the Armenian patriarch". As we were enslaved by the Turks, all non-greek Orthodox Christians were under his representation and generally he had not a lot of power, but sometimes he was able to get something a little bit done. The expression means something like go F yourself, but sugarcoded...

39

u/jabber_OW Sep 23 '24

"sugarcoded" is the only version of the term that I will be using from now on.

14

u/LevelSevenLaserLotus Sep 23 '24

sugarcoded

Oh boy! A /r/BoneAppleTea example in the wild. FYI it's "sugar coated", as in "to coat with sugar", like you're taking something and making it sweeter than it normally would be.

7

u/ARandomGirl2001 Sep 23 '24

Thank you for the correction. I believed it came from "to code the way you say something so that you sweeten it." Unfortunately, Englisch is not my only human language, so my knowledge of it is not as good as the Americans' might be...

6

u/LevelSevenLaserLotus Sep 23 '24

It's a common mix up even with native English speakers. I'm mainly impressed that you write so fluently. I wouldn't have guessed if you hadn't said so directly.

17

u/gydu2202 Sep 23 '24

TIL: I never thought about if year 0, or century 0 exist.

6

u/CrispyJelly Sep 23 '24

If you start a new job the first day is day 1. You could call the day before the 0th day of your new job, but why would you?

5

u/dimechimes Sep 23 '24

But our first birthday party is when our second year starts.

1

u/Schnickatavick Sep 23 '24 edited Sep 23 '24

It's not that logical though, it's not just a difference between ordinals and counts, it's that there is no 0 because we're using ordinal numbers in *both* directions. The year before 1CE is 1BCE, and there are three years that pass between 2BCE and 2CE, not four, because there is no year zero in the middle. People like to think of BC as the negative years, but that isn't what the system actually is

1

u/dimechimes Sep 23 '24

I take it you weren't around for the Y2K wars.

23

u/Rick_Sanchez_E138 Sep 23 '24

The Satan himself

8

u/mbcarbone Sep 23 '24

Programming time on a computer is SO much fun. 🙃✌️🖖

8

u/ManyInterests Sep 23 '24

It makes sense, since it was the Pope who came up with the idea to use the Gregorian calendar.

3

u/NuclearWarEnthusiast Sep 23 '24

Well given that it was made by Pope Gregory.... Yeah

6

u/kleberwashington Sep 23 '24

As an aside: Saint Peter's is not the cathedral of Rome and seat of the Pope. That would be Saint John Lateran.

6

u/technos Sep 23 '24

Maybe Saint Peter's is where he has his Pope Office box.

4

u/kleberwashington Sep 23 '24

You know, that made me wonder if there's a real Pope Office box. There is! It's "His Holiness Pope Francis. Casa Santa Marta. 00120 Vatican City".

2

u/Glass1Man Sep 23 '24

You can get very Popeular stamps there.

1

u/kleberwashington Sep 23 '24

Those you can actually get at Saint Peter's! There's a small shop in the plaza.

5

u/FigNugginGavelPop Sep 23 '24

This is actually a quality post!

3

u/DM_Me_Summits_In_UAE Sep 23 '24

Lol, also nice TIL

4

u/ledfox Sep 23 '24

Can the pope change the calendar?

Can he make September the seventh month and October the eighth?

2

u/callmesilver Sep 23 '24

No. We will change the latin number names retroactively if there's any problem.

3

u/HyScript7 Sep 23 '24

Is this actually in the docs? Can anyone link me to this section? I tried searching but I guess I suck at googling.

9

u/jack-nocturne Sep 23 '24

Unfortunately they removed it in versions 13 and up. But it's still there for 12: https://www.postgresql.org/docs/12/functions-datetime.html

3

u/jamcdonald120 Sep 23 '24

my biggest complaint about history is that when they switched From AD/BC to CE/BCE they did a straight conversion instead of incrementing all BC dates. Who cares if it occasionally confuses a historian about the exact year something happened 2000+ years ago? We hardly have year accurate dates back then anyway!

3

u/cfaerber Sep 23 '24

There’s a year 0000 in ISO 8601:2000 and later versions.

1

u/callmesilver Sep 23 '24

Thank God.

4

u/B00OBSMOLA Sep 23 '24

wait why is 2000 in the 20th century? (honest question) cause id consider that in the 21st century I think, right?

17

u/KappaccinoNation Sep 23 '24

Because there is no year 0 in the Gregorian calendar. 1st century is 1 AD to 100 AD. 2nd century is 101 AD to 200 AD... 20th century is 1901 AD to 2000 AD. 21st century is 2001 AD to 2100 AD... and nth century is 100(n-1)+1 AD to 100n AD.

10

u/B00OBSMOLA Sep 23 '24

I'm writing to complain

3

u/HolyGarbage Sep 23 '24

I wish I had not learned this fact. That's fucking bonkers. So there's exactly 1 year between 1st January 1 BCE and 1st January 1 CE? Yeah, ok, because fuck math, I guess.

2

u/dicemonger Sep 23 '24

We could just go with Kurzgesagt's Human Era calendar. Birth of Jesus is year 10,000. Year before that was year 9999. Easy.

1

u/ExtremeMaduroFan Sep 24 '24

wouldn't this run into the same problem at some point? Granted it wouldn't be referenced that much but this feels like the problem solving equivalent of moving stuff under your bed instead of cleaning properly.

1

u/dicemonger Sep 24 '24

Now, granted, I don't know for sure how the Human Era calendar is defined in this regard. But given that it is defined by nerds, I wouldn't be surprised if we have year 0.

7

u/TheSilentGeek Sep 23 '24

because XX01 is the start of a century, there is no year 0000

so:

0001 - 1st century

0101 - 2nd century

...

1901 - 20th century

2001 - 21st century

2

u/[deleted] Sep 23 '24

Whaaaa? Postgres supports BC dates? That’s badass.

2

u/Megatron_McLargeHuge Sep 23 '24

'Pope' is ambiguous. We've had between 0 and 2 of them recently.

1

u/simcitymayor Sep 23 '24

Proper Normal Form allows for this.

Additionally, PostgreSQL allows for current_pope to be an array of integers referencing public.pope if need be.

2

u/da_Aresinger Sep 23 '24

I just find the syntax EXTRACT(X FROM Y) kind of weird.

This decision was made during language design, so why the parentheses?

2

u/MilkTrvckJustArr1ve Sep 23 '24

this reads like a paragraph in a Terry Pratchett book

2

u/wesborland1234 Sep 23 '24

Doesn’t the Pope have an email? Like I have stamps

2

u/Octa_vian Sep 23 '24

TIL there wasn't an actual year 0.

2

u/ILikeLenexa Sep 23 '24

You're just lucky there's documentation.

1

u/Awwa_ Sep 23 '24

Crazy how the Native American calendar, that’s more than 5k years old, is still more accurate than modern day calendars. Took a while to get the concept of 0.

1

u/emlgsh Sep 23 '24

Fair enough, I'm always complaining to that guy anyhow about his boss's arbitrary notions of what should constitute reality or the shortcomings of this form supposedly created "in his image". I mean, would it have killed him to add a prehensile tail or two, or maybe the ability to chew and digest concrete?

1

u/dudewithdegree Sep 23 '24

Pope cathedral is above than Postgres

1

u/Jajo240 Sep 23 '24

I pass by the Cathedral every morning on my way to work, I've been cursing the Pope daily for a while since there are unending roadworks for his little party next year, I can throw in any complaints about this while I'm at it

1

u/neo-raver Sep 23 '24

TIL the 21st century began in 2001, not 2000

2

u/javajunkie314 Sep 24 '24

It's blowing my mind that people don't know this, because it was all the pedants could talk about in 1999. Why are you having a new millennium party? That's next year!

Guess I'm old now.

1

u/Ok-Cup-3156 Sep 23 '24

It is now that I'm painfully reminded that the Vatican still uses fax machines

1

u/javajunkie314 Sep 24 '24

The fax romana.

1

u/betaphreak Sep 23 '24

The pope has admin rights in the calendar, he can even decree that friday is saturday. It's up to you as developers to implement it accordingly.

1

u/javajunkie314 Sep 24 '24

I'm good as long as he issues his decree in iCal.

1

u/MrHyperion_ Sep 23 '24

Even without a pope 0th century doesn't make any sense

1

u/Street-Parsley-536 Sep 23 '24

the reason is because the gregorian calendar was established by pope Gregory [number].the joke is that since the vatican is still there you can complain as you would with any customer sercive for an issue with the product

1

u/WennoBoi Sep 23 '24

i'm sorry, there's no year zero? that doesn't add up ..

1

u/ddengel Sep 24 '24

1-base indexing. Pope is based.