this post was submitted on 22 Nov 2023
1036 points (95.9% liked)

Memes

44932 readers
2679 users here now

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.

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 16 points 9 months ago (4 children)
[–] [email protected] 21 points 9 months ago

Funny thing, in ISO 8601 date isn't separated by colon. The format is "YYYY-MM-DDTHH:MM:SS+hh:mm". Date is separated by "-", time is separated by ":", date and time are separated by "T" (which is the bit that a lot of people miss). Time zone indicator can also be just "Z" for UTC. Many of these can be omitted if dealing with lesser precision (e.g. HH:MM is a valid timestamp, YYYY-MM is a valid datestamp if referring to just a month). (OK so apparently if you really want to split hairs, timestamps are supposed to be THH:MM etc. Now that's a thing I've never seen anyone use.) Separators can also be omitted though that's apparently not recommended if quick human legibility is of concern. There's also YYYY-Wxx for week numbers.

[–] [email protected] 15 points 9 months ago (1 children)
[–] [email protected] 8 points 9 months ago

RFC3339! It's like ISO8601, but good!

[–] [email protected] 12 points 9 months ago (1 children)

YYYY-MM-DDTHH:MM:SS.SSSSSSSSSZ

[–] [email protected] 3 points 9 months ago* (last edited 9 months ago)

I love the nanosecond format! I was playing with the date command earlier and came across this.

[–] [email protected] 5 points 9 months ago (1 children)

This, but all run together.

I write files/reports to disk a lot from scripts, so that's my preferred format.

[–] naught 2 points 9 months ago (1 children)

I just go for a unix timestamp and use terminal/filemanager to sort by or display the datetime

[–] [email protected] 3 points 9 months ago (1 children)

Are you talking epoch? I don't care for that mainly because it's not human readable. I see the use for it, but I struggle with it in practical use.

[–] naught 3 points 9 months ago

Yep. I mostly like datetimes for simple sorting. If it needs to be human readable iso is the way to go tho.