Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Dates should be YYYY-MM-DD. You know, the only format that actually make sense and doesn't cause confusion.
@Irene I don't agree.
Who writes times as seconds:minutes:hours? It's always the other way around.
What we're discussing here is date-to-text conversion. The way texts are sorted is "lexicographically". That means that the first characters are way more important than the last ones. Since ORDER BY day, month, year just doesn't make any sense, the year should be first, then month, then day.
@irene You clearly have never worked with dates in programming. mm/dd/yyyy or dd/mm/yyyy are impossible to sort and a complete mess when it comes to parsing.
Furthermore, not everyone is using mm/dd/yyyy as their format. Some languages are using dd/mm/yyyy in spoken form and YYYY-MM-DD in written form (e.g. french).
Your argument about "importance" is complete nonsense. This is the same kind of thinking that led us to the infamous Y2K bug and the reason we still have major issues with accents / umlauts in many areas of programming. The thinking that the world revolves around the US English formats.
The goal is to have a format that you can understand immediately, without any confusion no matter your language or country, and that can be handled without any issues in programming.
Having dates like 01/05/2018 doesn't tell you whether it's mm/dd or dd/mm and is impossible to sort.
YYYY-MM-DD is the only format that checks about the boxes.
@irene Have you even read my reply at all? No matter if it's meant to be displayed to user or used internally in code, dd/mm/yyyy or mm/dd/yyyy is massively confusing. And who decided it should be dd/mm/yyyy? Most English speakers will say it's mm/dd/yyyy, while French speakers would choose dd/mm/yyyy.
What I said is not insulting, it's a fact. You don't fully understand all the complexity of dealing with dates until you had to program something with them.
YYYY-MM-DD is the best choice, no matter the situation or where it's used. It's internationally understood and there's no confusion.