Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You might be amused to browse Chrome's implementation of FTP, which has separate modules for each of the different types of FTP servers you might encounter, as each emits the "ls -l" output in a different way and that is (I guess) the only way to get file sizes.

http://git.chromium.org/gitweb/?p=chromium.git;a=tree;f=net/... see all the "directory listing" files.

The unit tests are full of scary cases like

  // Tests for "ls -l" style listing in Russian locale (note the swapped  
  // parts order: the day of month is the first, before month).


That's actually the standard European order. Testing the Russian locale might be a scary proposition, but certainly not for this specific reason.


It's not just the standard European order, it's the standard order for nearly everywhere on the planet except:

> MDY: Belize, USA, parts of Canada, Philippines, Saudi Arabia

> YMD: Japan, China, Iran, small bits of Europe

> DMY: Probably 3/4 of the planet's land surface

That said, YMD should make the most sense (and is most consistent with the universally accepted HMS time format). I try to use YMD wherever I can.


YMD is logical, because it puts the most significant number on the left.

But both DMY and HMS are consistent in another way - the information is ordered from most to least important for every day access, from left to right.

A vast majority of dates on advertising, tickets, timetables etc actually leave off the year, unless it's ambiguous. Similarly, one might say something like 'on the 4th', which implies 'the 4th of this month' (or the 4th of next month, if applicable).

This is the reverse of HMS, where the most significant number (the hour) is most important, and seconds are basically ignored day to day.

MDY, on the other hand, should be taken out the back and shot (IMO).


Absent any date-format-aware sort controller:

YMD will group results by year, then month, then day.

MDY will group results by month, then day, then year.

DMY will group results by day, then month, then year.

That's why all my filenames look like: YYYY_MM_DD_filename.suffix


[edited because I realized we're in violent agreement]

To me, MDY makes as much sense as writing pi as 14.3.159265


I might be missing something, but that's not at all what I was arguing!

MDY drives me nuts too.


It's more that different places use different versions that gets me. I have wrote a bunch of importers for sales an nearly all of them list the date time differently. Very few affiliate networks have used either a timestamp or the standards based datetime.


It's probably a legacy from how we tend to say dates.

"What's the date?"

"January 30th."


That used to be the case in the UK, but I notice more and more how I'm the only one actually using that form in conversation these days, at least in my little corner of Northern England. Indigenous people have clearly moved on to DMY, i.e. "the 30th of January".


In my opinion YMD is the most useful because it is the most visually distinct from the other two. A date like January 2nd 2012, when arranged in either MDY or DMY format, is difficult to distinguish from February 1st. YMD on the other hand is obvious, independent of what the reader is used to.


MDY is syntactically correct English: January 30th, 2012. Or in older form (where it would have come from): "Dated: January the 30th, in the year of our Lord 2012." Even the US Constitution is dated this way. I strongly prefer this way because it makes the most sense in the English language.

For programmatic sorting YMD makes sense because is automatically sorts by Y, M, D, if compared as a string. (EG: on a filesystem.)


> the information is ordered from most to least important for every day access

I argue that MDY is ordered from most to least important for every day access. Year is easily implied so it is last so that leaves month first and then day. You'd be surprised how many Canadians, which is officially DMY, actually prefer MDY.


Here's a nice stimulus bill for the US economy: mandatory switch from MDY to DMY. That should keep "a few" programmers busy for years! I'm not joking, that's how you move the economy: it's the digital equivalent of building a new bridge.

(It'd be more forward-thinking to actually switch to YMD, but I can imagine the reactions at the idea of aligning with Iran and China.)


In my country YMD and DMY are used, and I don't see, which is more prevalent. And some people use "." some use "/" and some use "-" as separators. It doesn't seem to cause any problems. You just need to validate inputs (best - show example as the default value), and know which foramt you use.

But MDY is just ugly and should die. It's almost as strange, as German way of saying 123. One hundert, three, and twenty :) Who invented this.

EDIT: didn't wanted to insult Germans :)


The comment says "Russian" because they really test the month name in Russian: "23 май 2011".

  -rwxrwxr-x 1 ftp ftp 123 23 \xd0\xbc\xd0\xb0\xd0\xb9 2011 test
The note about day, month order is useful because all other tests have "%b %e" format and rows are full of other numbers:

  drwxr-xr-x1732 266      111        90112 Jun 21  2001 .rda_2

http://git.chromium.org/gitweb/?p=chromium.git;a=blob;f=net/...




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: