FOM: File Name Dates

File Organization/Management: File Name Dates

      Today is 2020-03-13.

      On a computer, there is only one ‘correct’ format for entering that date. Year-Month-Day. Year done as four digits, month and day as two digits, with a minus sign linking them together.



      Traditionally, in the world of pen and paper, dates have been written as month/day/year. Often with a two digit year, and almost always without padding zeros. When using paper and the mark one eyeball, that is fine. But much of what we do now is in the digital land of computers.

      It’s all about most significant (largest) unit first. Then gradually decreasing as you go along. Look at time as a comparison. It’s hours:minutes:seconds. Imagine the headache if it was done minutes:seconds:hours. Yet that’s how we do dates.

      And don’t even mention using words. April becomes the first month, September the last. And while June and July stay in the middle, they switch order.



      The minus sign is used, instead of the slash (or backslash), because both slashes are reserved characters under most file systems. Try to stick one in a file name and it will complain. Inside the contents of a file is fine, but not the name. Incidentally, try it and you’ll get a list of other reserved (and thus forbidden) characters in the filename.
      
      Those of you old enough to remember the Year 2000 Problem should know why four digits are needed for the year. For the younger among you, that was when, in the year 2000, a number of computers would drop back to 1900, instead of 2000. In the end, that was mostly a non-event. But it did illustrate the value of having four digits for year.



      And lest you think I am in some way declaring myself ‘correct’: See ISO 8601, xkcd 1179 (or it’s explanation). Wiser (and funnier) men then I worked this out.



Examples
      Some examples of both why this is important, and how it can go wrong are below.

      Traditional: Month-day-year. In the picture below, note how March (03) of 2020 is below February (02) of 2021. Because the year is at the end, the month is sorted first.

      Padding zeros: 03, not 3. In the picture below, note how October (10) is before February (2). The 1 sorts before the 2, all else being equal. As an aside, while the current version of Windows does not do this by default, that the option can be turned off shows Microsoft is aware of the negative side effects it can cause.

      Date/Name order: Does the date go before or after the rest of the file name? The images below show both methods.

Unlike the date itself, this is more about how it will be used. I use both of these at various times. Sometimes it’s more important the dates show first, others the file name. In the end, like with the digits themselves, probably best to have whichever is more significant first.





      Brought this up because all too often I’m interacting with people who put dates in their file names, yet they don’t use this convention. I find it useful to use a date format that can more easily sort. Others don’t, for whatever their reasons. As computers are tools for the using, in the end, it’s all about what is most useful.

Leave a Reply