this post was submitted on 18 Dec 2024
762 points (99.0% liked)

memes

10636 readers
2692 users here now

Community rules

1. Be civilNo trolling, bigotry or other insulting / annoying behaviour

2. No politicsThis is non-politics community. For political memes please go to [email protected]

3. No recent repostsCheck for reposts when posting a meme, you can only repost after 1 month

4. No botsNo bots without the express approval of the mods or the admins

5. No Spam/AdsNo advertisements or spam. This is an instance rule and the only way to live.

Sister communities

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 19 points 14 hours ago (2 children)

Well, I looked at a Year 10000 problem less than 2 hours ago. We're parsing logs to extract the timestamp and for that, we're using a regex which starts with:

\d{4}-\d{2}-\d{2}

So, we assume there to be 4 digits for the year, always. Can't use it, if you live in the year 10000 and beyond, nor in the year 999 and before.

[–] [email protected] 11 points 14 hours ago

Just start over at year 0000 AT (after ten thousand)

[–] [email protected] 5 points 14 hours ago (1 children)

The ISO time standard will certainly need to be redone

[–] [email protected] 4 points 13 hours ago (2 children)

Do you think so? Surely, it's able to handle dates before the year 999 correctly, so I'd also expect it to handle years beyond 10000. The \d{4} is just our bodged assumption, because well, I have actually never seen a log line with a year that wasn't 4 digits...

[–] [email protected] 6 points 13 hours ago (1 children)

Kinda?

Each date and time value has a fixed number of digits that must be padded with leading zeros.

To represent years before 0000 or after 9999, the standard also permits the expansion of the year representation but only by prior agreement between the sender and the receiver.[21] An expanded year representation [±YYYYY] must have an agreed-upon number of extra year digits beyond the four-digit minimum, and it must be prefixed with a + or − sign[22] instead of the more common AD/BC (or CE/BCE) notation; by convention 1 BC is labelled +0000, 2 BC is labeled −0001, and so on.[23]

[–] [email protected] 3 points 10 hours ago

Oh wow, I really expected the standard to just say that however many digits you need are fine, because you know, maths. But I guess, this simplifies handling all kinds of edge cases in the roughly 7975 years we've still got.