• chickenf622@sh.itjust.works
    link
    fedilink
    arrow-up
    13
    ·
    edit-2
    4 天前

    ISO 8601 RFC 3339 (yyyy-mm-dd) for storing dates in software. Any format that that goes in the order of day, month, and year for conversational/presentational purposes, preferable the format is dynamic depending on the user’s locale (even for those that want the month first). There now everyone is happy.

    Edit: switched to RFC 3339 since it is a subset of ISO 8601 that is more strict, and I love semantics.

    • dan@upvote.au
      link
      fedilink
      arrow-up
      8
      ·
      edit-2
      4 天前

      RFC3339 is better than ISO8601 since it doesn’t allow some of the esoteric formats, and allows some useful formats that ISO8601 doesn’t (like separating date and time by a space instead of by T)

      For example, 2026-W32-1 is also a valid ISO8601 date: Monday on the 32nd week of 2026. That format isn’t allowed with RFC3339.

      https://ijmacd.github.io/rfc3339-iso8601/

      • chickenf622@sh.itjust.works
        link
        fedilink
        arrow-up
        3
        ·
        4 天前

        Damn it I forgot about the duration part of ISO 8601 (which is also super useful and I love it). I’ll amend it to RFC 3339 to be more exact in what I mean (even though the specified format should prevent the more esoteric formats).

        • The_Decryptor@aussie.zone
          link
          fedilink
          English
          arrow-up
          2
          ·
          3 天前

          Don’t forget about RFC 9557 though, which is an update to 3339 to bring it into closer alignment with ISO 8601 (regarding UTC).