▲ | jchw 2 days ago | |
> Please don't use dd-mm-yyyy I wasn't listing a date format, but a date order; the dashes were not meant to be separators. That said, I tend to use year-month-day, in RFC-3339 format. Although I honestly don't lose sleep about it. > It's better to use different separators to clarify the date format. The three common formats are yyyy-mm-dd, dd.mm.yyyy and mm/dd/yyyy. As an American, I most commonly see day-month-year written as "April 17th, 2025" or "4/17/2025". I'm sure "4.17.2025" exists, but e.g. it is not what a locale-aware date formatter will output for U.S. locale. Here's my hot take: One should generally either use locale-specific date formatting, or use RFC 3339 or ISO 8601. They both have a time and a place where they are more appropriate. Sometimes it's just simply going to be more correct and less confusing to use a locale-specific date format, especially if you have to deal with passing dates between different entities. (As an example, if I were filing legal documents, I would most assuredly use the standard in a given locale for dates. Maybe a long, unambiguous form just to be safe, if it happens to be applicable.) In any case, using another option that isn't either of these seems counter-productive to me. I think it's weird how people get overly attached to issues like these. It is a shame that date formats can be ambiguous, occasionally causing preventable problems, but we'll survive. Stuff like this doesn't get fixed over night. |