But that is not how the files actually will be ordered on the machine. That may look nice and even easier to read, etc. Ideally it would look something like this: Sunday-Aug-04-2019 As before, say we have a folder that contains a file for each day of the week. But for the sake of thoroughness, let’s look at one more example, where actual names are used in dates. Using spelled-out names for months and daysīy now you should see where this is going. So this format also is not optimal because it is not scalable and does not preserve calendrical order. Notice how the dates alternate between 20 and 21? It’s just bonkers. Consider the following, where we have a folder containing one file for each month of the year: 1Īs with previous examples, this ordering breaks down if either more days or added or more months are added. Putting the year first followed by the day then month. I mean, imagine if we added more than one day per month per year: In order to make sense of this, you have to look at the end of each line to get the year information. For example, adding more months with the same day begins to confuse: Including only one year’s worth of months is gonna be fine: īut as before this is not scalable. Again let’s use the example of archived files in a folder. Just as with putting the day first, putting the month first in dates leads to chaos. So in addition to not scaling, day-first formats fail at preserving calendrical order. And it gets increasingly complex as more days are added. So the files/dates are alternating from February to March, which is confusing at best. That is, if you add files for each day in March, the results get jumbled: For example, if you have a folder that contains one file for each day in the month of February, 2030: Īnd all is well. When working with only one month’s worth of days at a time, it’s fine to put the day first, because all of the days will be in numerical order. To understand this, consider some examples. Doing so preserves calendrical/chronological order and is infinitely scalable. But when working with multiple dates, like with archived files, it’s always best to write numerical dates in descending order. Numerical Order is the Keyįor one-off dates, like when filling out a form or something, you can use whatever date format makes sense. YEAR/MONTH/DAY format maintains perfect calendrical order and scales infinitely. So it begs the question, is there an optimal way to write dates? Why yes in fact, there is. With the scripting language PHP for example, there are many ways to format a date. Any programmer will tell you that there are endless variations and possibilities. Or perhaps a more common example is month, day, year, like. And there are many ways to order that information. Arguably the most common way to express a date is to include the day of the month, the month, and the year.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |