Name your files for proper date sorting

Ever include dates in your Office document filenames? If you're archiving files and want them to sort properly, there's a format you should follow.

Say that you archive final copies of your company newsletter with the date it was sent to customers. You might be tempted to use Newsletter-010410.docx to represent January, 4, 2010. (Or, if you're in a country that puts the day first, you might choose 040110.)

At first glance, this looks fine. Later newsletters sorted by file name will fall under your January 4th edition - until next year (or next month, if you put the day first). Then they start to fall out of sequence. For example, you would not want your files to sort like this:

Newsletter-011011.docx (see, this is from 2011!)

The best practice here is keep naming consistent and then use YYMMDD format, so they sort by year, then month, and then day:


Feel free to use hyphens to separate the date sections and make them more readable - as long as you're consistent, they will sort just fine.

This tip ought to hold you for the next 90 years, or you could include the full year (2010) if you believe your archive will persist and still need to be sorted properly in the year 2100.