• @[email protected]
        link
        fedilink
        22 years ago

        Whenever I’m passing a date from a website backend to frontend I’ll usually send it inside something like <span> then have JavaScript convert it to a string based on the browser’s localization settings.

        So many websites I see for error reporting, etc always throw everything out as UTC and it drives me crazy. It would be nice to just have an HTML tag for ISO-8601 (or even UNIX as done here).</span>

      • @[email protected]
        link
        fedilink
        English
        132 years ago

        In a programmatic context? Sure.

        In an “I want to be able to comprehend this by glancing at it” context: absolutely not.

        2023-08-10 15:45:33-04:00 is WAY more human legible than 1691696733.

  • @[email protected]
    link
    fedilink
    English
    392 years ago

    ISO 8601 is amazing for data storage and standardizing the date.

    Display purposes sure, whatever you feel like

    But goddammit if you don’t use ISO 8601 to store dates, I will find you, and I will standardize your code.

    • @[email protected]
      cake
      link
      fedilink
      42 years ago

      I actually need to standardize my code. I’ve got “learning F2” as something I want to do soon. The goal: use the exif data of my pictures to create [date in ISO 8601] - [original filename].[original file type termination]

      So a picture taken the third of march 2022 titled “asdf.jpg” would become “2022-3-3 - asdf.jpg”

      Help? lol

      • @[email protected]
        link
        fedilink
        62 years ago

        If you’re on Linux exiftool can get the creation date for you: exiftool -p '$CreateDate' -d '%Y-%m-%d' FILENAME, and you could run tgat in a loop over your files, something like:

        mkdir -p out
        for f in *.jpg
        do
        createdate=$(exiftool -p '$CreateDate' -d '%Y-%m-%d' "${f}")
        cp -p "${f}" "out/${createdate} - ${f}"
        done
        

        Obviously don’t justbgo running code some stranger just posted on the internet, especially as I haven’t tested it, but that should copy images from the current directory to a subdirectory called ‘out’ with the correct filenames.

        • metaStatic
          link
          fedilink
          22 years ago

          ok I think I finally need to ask

          What the fuck is up with the html code? Ive seen this in a lot of posts and it just throws me every time.

        • @[email protected]
          cake
          link
          fedilink
          12 years ago

          I’m using NixOS. Ext4 filesystem. As to language, I’m not entirely sure what you mean. If you refer to the character set in the filenames, I think there are no characters that deviate from the English alphabet, numbers, dashes, and underscores.

          • @[email protected]
            link
            fedilink
            English
            12 years ago

            Oh ok so you’re more so working with folder structure etc, so bash for when you plug-in a card?

            I’m thinking in more programmatic terms, there’s definitely some bash scripting you can execute. Or just go balls out and write a service that executes on systemctl

  • @[email protected]
    link
    fedilink
    English
    32 years ago

    Facts. The sorting system for files inevitably makes YYYY-MM-DD more optimal. I tried to resist but it doesn’t work.

  • @[email protected]
    link
    fedilink
    242 years ago

    To the commenters justifying the written form MM-DD-YYYY on the basis of preferring to say the name of the month followed by the day (which the written numerical sequence does not preclude you from doing). If someone were to say something like “the time is a quarter to eleven” do you think they would have a case for writing it 45:10? And if so, how would you deal with the ambiguity of “ten past ten” if they wrote it 10:10 instead of 10:10?

  • @[email protected]
    link
    fedilink
    772 years ago

    ISO 8601 gang. You’d never want to describe dates that way but for file management the convenience is massive.

  • @[email protected]
    link
    fedilink
    1892 years ago

    I’m definitely in the “for almost everything” camp. It’s less ambiguous especially when you consider the DD/MM vs MM/DD nonsense between US dates vs elsewhere. Pretty much the only time I don’t use ISO-8601 is when I’m using non-numeric month names like when saying a date out loud.

    • @[email protected]
      link
      fedilink
      202 years ago

      In Canada we use MM/DD and DD/MM so you never quite know which it is! There’s an expense spreadsheet I fill out for work that uses one format in one place and the other format in another…

    • Dr. Wesker
      link
      fedilink
      English
      232 years ago

      Yeah, it’s pretty much everything for me too. The biggest exception being when UI is involved and a longhand date format would be more friendly.

      • genoxidedev1
        link
        fedilink
        52 years ago

        Yes, MM DD YY only makes sense when you’re speaking.

        In written language it should always follow the order of smallest to largest, meaning day, month, and then year. Imo.

        Though I personally try to use YYYY-MM-DD as much as possible in day to day life, if not applicable I use DD MM YYYY. YYYY-MM-DD of course doesn’t follow the order of smallest to largest, instead following the opposite order, though at least it has an order.

        • @[email protected]
          link
          fedilink
          3
          edit-2
          2 years ago

          Largest to smallest is way more logical than smallest to largest. You start general and get more specific as you progress. It is in general a better approach to conveying information and cataloging data. Not just dates.

          • @[email protected]
            link
            fedilink
            English
            12 years ago

            Yeah but if you’re communicating a date, then it’s likely that the larger chunks of time will match and can be ommitted, so it’s natural to go up the chain in until you hit the day/month/year that matches the current one. Although I guess that’d imply using minutes before hours… I guess you could go large to small and skip anything that matches too. Nvm lol

        • @[email protected]
          link
          fedilink
          English
          8
          edit-2
          2 years ago

          When does saying the month first ever help when you’re speaking? The month doesn’t change for like 30 days. The only thing that matters is dd which changes daily. If someone asks me what the date I’ll give them the day date and nothing else.

          I don’t need to say it’s the 9th and watch them panic that maybe it’s January.

          • genoxidedev1
            link
            fedilink
            52 years ago

            I don’t even know how to reply to this.

            So if you made an appointment for the 2nd of September you’d tell 'em “yeah let’s meet on the 2nd” or “yeah let’s meet on the 245th” you’re gonna need the month somewhere.

            Of course if it’s the same month it wouldn’t make a difference if you said “let’s meet on the 10th” or “let’s meet on the 10th of August” but if you’re making appointments for different months which in everyday life or in a work environment is not unusual you can’t just say “yeah the 2nd” and expect them to know which month. “Yeah you can expect delivery by the 4th”.

            Tl;Dr:
            I didn’t even say “it’s the only way to say it when speaking” I said “only makes sense when you’re speaking.” because in written form MM DD YY is just shit for everyone except Americans, to the point where context sometimes is the only saving grace. Vice versa applies.

            • @[email protected]
              link
              fedilink
              English
              22 years ago

              Yep you’re 100% right. My job start date was miscommunicated because of this, they were like “you start on the 17th”… turns out it was the next month. Better than getting it wrong in the other direction though for sure!

        • @[email protected]
          link
          fedilink
          2
          edit-2
          2 years ago

          Yes, MM DD YY only makes sense when you’re speaking

          For many people it doesn’t. It’s something that’s exclusive to the US. In British English it’s day before month when speaking.

          It’s something that is taught in school as “remember that the Americans say date before month so you don’t get confused”. But in a business context it’s bloody annoying you don’t switch to the international standard.

          • genoxidedev1
            link
            fedilink
            12 years ago

            Yes, we also do days first in Germany.

            Like I replied to someone else in this thread: I wasn’t saying “it’s the only way that makes sense when speaking” I said “it only makes sense when speaking”. That doesn’t make any other way of saying dates make less sense when speaking though.

    • robot_dog_with_gun [they/them]
      link
      fedilink
      English
      22 years ago

      i’ve seen some software use . although that’s less human-readable than -. i hope you still use 8.3 naming on everything if you’re complaining about two hyphens.

    • @[email protected]OP
      link
      fedilink
      42 years ago

      Wrote it on another comment, this way it loses human-readable a bit.

      I saw these with hh:mm:ss all without keystrokes. That’s the worst.

  • @[email protected]
    link
    fedilink
    42 years ago

    This is me but without the dashes. Haha I know l, what’s wrong with me…

    But I’ve also started using 10/Aug in emails to make things crystal clear.

    Anyway.

    • @[email protected]
      link
      fedilink
      English
      12 years ago

      Yeah if the day of the month is less than 12 and any other format is used it becomes a guessing game.