Dates in filenames
Cliff Brake December 20, 2024 #dates #naming #consistencyOne of the most common labels we use today is dates. We use them in file names, reports, database fields, etc. There are many ways to enter a date:
2024-12-20
20 Dec 24
12/20/2024
20/12/2024
Dec 20, 2024
- etc.
RFC 3339 (YYYY-MM-DDTHH:MM:SS+HH:MM
)
is increasingly becoming an international standard. Many programming languages
(Go, Rust, Javascript, Elm) support RFC 3339.
What about when naming files? It is often helpful to put a date in directory or file names so you can easily sort to find the latest or construct a timeline of events. In this case it makes sense to format the date general to specific YYYY-MM-DD and put the date at the beginning of the filename:
2024-10-20_project-requirements.docx
2023-11-01_architecture-rev1.pdf
2024-11-11_architecture-rev2.pdf
2024-12-15_release-v1/
With a little thought, even simple things like file and directory names can become useful metadata that is easy to sort and query. Consistency and standards -- simple things you can do to make things better.