• ISO 8601 is paywalled
  • RFC allows a space instead of a T (e.g. 2020-12-09 16:09:…) which is nicer to read.
113 points
*

Top post of the hour is about an RFC from >20 years ago.

This is worse than the Linux stuff.

Y’all a bunch of nerds

permalink
report
reply
99 points

You’re not wrong

permalink
report
parent
reply
50 points

Room for one more

permalink
report
parent
reply
21 points

One of us, one of us, one of us

permalink
report
parent
reply
30 points

Being a nerd is fun.

permalink
report
parent
reply
10 points

Thanks /u/OsrsNeedsF2P!

permalink
report
parent
reply
3 points

I’m a Linux nerd and even I don’t get this 😭

permalink
report
parent
reply
108 points

A space is more problematic than a T tho

permalink
report
reply
58 points

Skill issue

permalink
report
parent
reply
43 points

For a skilled pro like you I suggest using epoch time for everything

permalink
report
parent
reply
4 points

Cassandra uses epoch milliseconds for timestamping snapshots. This means that each node will have a different name for the same snapshot. Trivially solved with truncating the timestamp with * wildcard, but just… why?

permalink
report
parent
reply
30 points

Any other day I’d see this get laughs, but I guess people are bitchier this time of day.

I’d write down the ISO timecode I’m talking about, but I can’t afford it.

permalink
report
parent
reply
74 points
*

You’ve just become the nemesis of the entire unix-like userbase for praising the space.

permalink
report
reply
21 points
*

What’s the issue with the space?

permalink
report
parent
reply
45 points

On the command line, space is what separates each argument. If a path contains a space, you either have to quote the entire path, or use an escape character (e.g. the \ character in most shells, the backtick in Powershell because Microsoft is weird, or the character’s hexadecimal value), otherwise the path will be passed to the command as separate arguments. For example, cat hello world.txt would try to print the files hello and world.txt.

It is a good practice to minimize the character set used by filenames, and best to only use English alphanumeric characters and certain symbols like -, _, and .. Non-printable characters (like the lower half of ASCII), weird diacritics (like ő or ű), ligatures, or any characters that could be misinterpreted by a program should be avoided.

This is why byte-safe encodings, like base64 or percent-encoding, are important. Transmitting data directly as text runs the risk of mangling the characters because some program misinterpreted them.

permalink
report
parent
reply
5 points
*

but what does the command line matter for dates? sure every once in a while you’ll have to pass a date as an argument on the command line but I think usually that kind of data is handled by APIs without human intervention, so once these are set up properly, I don’t see the problem

permalink
report
parent
reply
4 points

I’m not exactly fond of the space either, but man, the T is noisy. They could’ve gone with an underscore or something, so it actually looks like two different sections.

permalink
report
parent
reply
57 points

allows a space instead of a T

That’s a bug not a feature

permalink
report
reply
4 points

allows, not requires. It basically means you can use space instead of T when showing it to end users and any technical person can just use T

permalink
report
parent
reply
3 points

Development wise, It’d be better if it’s required not allowed. Best case scenario, it’s just another redundant if statement.

permalink
report
parent
reply
2 points

The amount of things allowed by ISO 8601 is even more than what’s allowed by RFC 3339, if you take the time to look at https://ijmacd.github.io/rfc3339-iso8601/

permalink
report
parent
reply
1 point

It’s really a skill issue if replacing T by [T ] in your regexp is hard

permalink
report
parent
reply
12 points

This is the most junior developer comment I’ve seen in a while.

Nobody that’s competent thinks that’s shit is hard. That’s not the point.

The point is, it makes it easy to make mistakes. Somebody might see all of one type of strings, assume that’s the format, and forget to enclose the thing in quotes, causing mysterious bugs years later when a differently created date filters into the system. You might have a regex error, you might split incorrectly, you might make a query that works the wrong way and gives an incorrect aggregate, and none of that is due to lack of skill. It’s due to not knowing it’s the rfc standard, not the iso. It could be due to not even realizing the rfc allows for that or is different.

Software engineering in practice is not about making sure there is at least some way for people to use your library/standard/pattern. It’s about making sure the way to do it that’s most intuitive/obvious is also foolproof, easy, and efficient. Adding the space makes debugging harder and adds footguns which is exactly what good software engineers want to stay away from. Otherwise we’d all be writing in assembly. But since you aren’t, maybe you are the one with a skill issue. Either that or you really misunderstand this field.

permalink
report
parent
reply
42 points

The difference:

2023-12-12T21:18Z is ISO 8601 format

2023-12-12 21:18 is RFC 3339 Format

A small change

permalink
report
reply
26 points

ISO 8601 also allows for some weird shit. Like 2023-W01-1 which actually means 2022-12-31. There’s a lot of cruft in that standard.

permalink
report
parent
reply
8 points

This is the killer for me. Most people promote ISO 8601 as a “definitive” date structure, when it actually supports a lot of different formats. What they actually want is usually RFC 3339.

permalink
report
parent
reply
8 points

Doesn’t the ISO also includes time periods? Because if it does, those are amazing.

Without any explanation, you should be able to decypher these periods just by looking at them:

  • P1Y
  • P6M2D
  • P1DT4H
  • PT42M
permalink
report
parent
reply
1 point

Hmm I don’t get the T there tbh

permalink
report
parent
reply
3 points

Week numbers are convenient for projects in which key delivery dates are often expressed in his many weeks out they are.

permalink
report
parent
reply
2 points

wtf what is that gross

permalink
report
parent
reply
14 points

That Z is doing a lot of work.

permalink
report
parent
reply
10 points

Z indicates UTC. Alternatively,

2023-12.12T21:18-05 for time zone as central. The UTC time zone code at the end just tells you where the time is taken from. Usually Z is used since, well, it’s “universal,” but having a +13 or -06 or whatever else brings context, and allows computers to synchronize the string of text into a comparable time for event logs and such.

permalink
report
parent
reply
12 points

Yes. The RFC is missing something that explicitly indicates the time zone. The Z is a great unambiguous way of saying “yes, this is UTC.”

permalink
report
parent
reply
5 points

I definitely don’t agree that the RFC is easier to read, the two numbers can appear to be one at a quick glance without a separator.

permalink
report
parent
reply
17 points

But there is a separator between the numbers: the same one that also very reliably separates the words in this comment

permalink
report
parent
reply
1 point
  1. A single separator is better than a choice of separators to mean the same thing.
  2. A space is not as apparent in a large log of data as a capital T
  3. Human language is not as strict as a programming language. There is a reason you see people still using “alot” and “a lot”. That just proves it’s easy to overlook and commonly happens.
permalink
report
parent
reply
3 points

Both are valid (if you’d add seconds) in both RFC 3339 and ISO 8601, but timezone support is the same here and there…

permalink
report
parent
reply

Memes

!memes@lemmy.ml

Create post

Rules:

  1. Be civil and nice.
  2. Try not to excessively repost, as a rule of thumb, wait at least 2 months to do it if you have to.

Community stats

  • 11K

    Monthly active users

  • 13K

    Posts

  • 288K

    Comments