r/ProgrammerHumor • • 18h ago

Meme [ Removed by moderator ]

/r/ProgrammerHumor/comments/1y9d2e9/removed_by_moderator/

[removed] — view removed post

4.3k Upvotes

220 comments sorted by

View all comments

3

u/pkinetics 18h ago

Never heard of this when I did COBOL. Sounds more urban legend.

11

u/RCJHGBR9989 18h ago

COBOL is an urban legend - the only people who know how to write or decipher it are ancient wizards, warlocks, and some guy in Nebraska who only posts in Hannah Montana memes. /s

3

u/muhkuller 18h ago

Or Air Force programmers. That sounds specific, but it's true.

1

u/nishinoran 14h ago

It is an urban legend to score some cheap political points. COBOL integer dates (in days) start December 31, 1600. IBM COBOL dates (in days) uses October 14th, 1482.

The closest thing we have to 1875 every being a standard is that it's mentioned in the 2004 version of ISO 8601 as a potential historical calendar reference for the date that the Metre Convention was signed (May 20th), but it was never used.

This claim got parroted by a bunch of media outlets all too happy to dunk on Musk.

-6

u/muhkuller 18h ago

Every programming language has a base date. For most it's Jan 1, 1959 or 1969. Every datetime is a number based on days before or after that date. Jan 2, 1959 is simply a datetime of 1, Dec 31, 1958 is -1. Then you add decimal points for hours/min/second/milliseconds. You just never see it because there are default formats that the datetime is displayed in. Storage is cheap so we tend to just store stuff in the full UTC now, but if you do math on a datetime it's still doing math on that raw number that's behind the scenes.

7

u/blackers3333 17h ago

No, this is not the case in cobol.

9

u/McFestus 18h ago

It's Jan 1st 1970 for nearly all things. Not sure where you got 1959 or 1969 from.

3

u/Xavier_OM 17h ago

FYI Unix tracks time in 1s units since January 1, 1970, but Windows tracks time in 100ns units since January 1, 1601

(beginning of the 400 year period including Windows release, because extra leap day occurs in each year that is a multiple of 4, except for years evenly divisible by 100 but not by 400)

2

u/Taurmin 17h ago

Thats only really for systems that save the date as a unix timestamp.

In SQL its 01/01/1753, because 1752 is the year a bunch of countries switched to the gregorian callendar and doing any kind of date math across that shift gets a bit wonky.

1

u/muhkuller 17h ago

Different languages use different starting points. I've used some old languages. That's why I didn't state that was the starting point for all.

1

u/McFestus 17h ago

You said "for most" which I don't believe is true. Perhaps there are one or two rare examples.

1

u/muhkuller 17h ago

Fine, sure. The point isn't about establishing an exact date in which the majority of languages base their dates. It's to explain that languages use SOME date to establish as day 0.

1

u/McFestus 16h ago

Your words were literally "for most"

1

u/muhkuller 16h ago

Yup. I’m agreeing I used the wrong word. Anything else to add to the part that’s not the point being made?

1

u/McFestus 16h ago

Edit button

1

u/muhkuller 16h ago

Why rob other readers of an example of how people make a mistake, admit they made a mistake, and move on without a conversation devolving into nonsense.