I wanted to give my take on the debate about which date and time format is the best.
The are 3 main formats for dates and 2 for time.
D/M/Y, Y/M/D, M/D/Y, 12 and 24 hour time. There are other formats but these are the main ones.
So why do I use Y/M/D 24h in a country that uses D/M/Y 12h?
It's simple really but first, lets all agree that M/D/Y makes no dam sense.
Anyway, moving on, D/M/Y and Y/M/D Makes sense because it goes from smallest to biggest or biggest to smallest and they can be easily swapped between but the biggest reason is due to how a computer counts.
The most commonly used counting system is the hexadecimal (edit: sorry, I meant base36, hexadecimal is base 16) system which is from of 0 to Z. So 0, 1... 9, A, B... Z and symbols have their own block but that varies bit as to which character-encoding scheme is used.
If you have a set of files that all start with the date and you sort by name.
Under the D/M/Y system you get,
01-01-2010
01-02-2010
01-10-2009
01-11-2009
02-10-2009
02-11-2009
29-09-2009
29-10-2009
30-09-2009
30-10-2009
31-10-2009
Obviously this is all messed up but have a look at Y/M/D
2009-09-29
2009-09-30
2009-10-01
2009-10-02
2009-10-29
2009-10-31
2009-11-01
2009-11-02
2010-01-01
2010-02-01
They all sort into nice blocks of Year then Month then Day. Of course names can then be attached after the date and they will sort alphabetically.
The most important thing though is the leading zeros because computers count from 0 not 1. The same is true for 12h vs 24h time but the leading zeros aren't needed although I think it makes it easier to read.
Now D/M/Y is in my opinion more intuitive for humans so I don't think we're going to lose it anytime soon but that may actually be best as both systems can or more accurately are interchangeable. M/D/Y is not compatible and a lot of confusion is born out of that, the same could also be said for the imperial system which, the British invented and they've been slowing moving over to the metric system for the last couple of decades. And they have it much harder then the USA in that regard for sure so the US doesn't really have an excuse for keeping the imperial system except, for the fact that it annoys the rest of the world.
Anyway I'll end it there before I go on a massive tangent about other things I don't like about the USA which will end up on a world tour.
I feel like I missed something and to be honest I probably did. If I did, leave a comment yelling at me about it. As always if you have any questions at all, leave them somewhere and I'll get back to you.
じゃあね Ciao
.AJ-R. -アパゾ
The are 3 main formats for dates and 2 for time.
D/M/Y, Y/M/D, M/D/Y, 12 and 24 hour time. There are other formats but these are the main ones.
So why do I use Y/M/D 24h in a country that uses D/M/Y 12h?
It's simple really but first, lets all agree that M/D/Y makes no dam sense.
Anyway, moving on, D/M/Y and Y/M/D Makes sense because it goes from smallest to biggest or biggest to smallest and they can be easily swapped between but the biggest reason is due to how a computer counts.
The most commonly used counting system is the hexadecimal (edit: sorry, I meant base36, hexadecimal is base 16) system which is from of 0 to Z. So 0, 1... 9, A, B... Z and symbols have their own block but that varies bit as to which character-encoding scheme is used.
If you have a set of files that all start with the date and you sort by name.
Under the D/M/Y system you get,
01-01-2010
01-02-2010
01-10-2009
01-11-2009
02-10-2009
02-11-2009
29-09-2009
29-10-2009
30-09-2009
30-10-2009
31-10-2009
Obviously this is all messed up but have a look at Y/M/D
2009-09-29
2009-09-30
2009-10-01
2009-10-02
2009-10-29
2009-10-31
2009-11-01
2009-11-02
2010-01-01
2010-02-01
They all sort into nice blocks of Year then Month then Day. Of course names can then be attached after the date and they will sort alphabetically.
The most important thing though is the leading zeros because computers count from 0 not 1. The same is true for 12h vs 24h time but the leading zeros aren't needed although I think it makes it easier to read.
Now D/M/Y is in my opinion more intuitive for humans so I don't think we're going to lose it anytime soon but that may actually be best as both systems can or more accurately are interchangeable. M/D/Y is not compatible and a lot of confusion is born out of that, the same could also be said for the imperial system which, the British invented and they've been slowing moving over to the metric system for the last couple of decades. And they have it much harder then the USA in that regard for sure so the US doesn't really have an excuse for keeping the imperial system except, for the fact that it annoys the rest of the world.
Anyway I'll end it there before I go on a massive tangent about other things I don't like about the USA which will end up on a world tour.
I feel like I missed something and to be honest I probably did. If I did, leave a comment yelling at me about it. As always if you have any questions at all, leave them somewhere and I'll get back to you.
じゃあね Ciao
.AJ-R. -アパゾ
errr... "hexadecimal system which is from of 0 to Z"...? hexadecimal is base 16, not 36... :P hexa- is 6, hexa-decimal is 16. That means, 0..9, and A..F. Mostly, computers use, as everyone knows, binary, which is 0..1 (bi- being two), and the whole hexadecimal thing (one hexadecimal digit typically being called a "nibble", and exactly half of a "byte") is just the nearest binary power at least as big as the decimal system we humans know and love. (Base 36 isn't a binary power, the nearest one is 32 which is smaller, and the next largest and quite frequently used one being 64, which uses 0..9, A..F, a..f, and two extra's — typically some choice from "_", "-", "+", or "/" — which happens to be 6 binary digits, giving a convenient 3:4 ratio with bytes.) The zero's, also, are more for padding, than any computer counting issue. It's fairly easy — but non-trivial, and therefore time consuming in both programmer man-hours and CPU runtime — to build a lexicographical sort that interprets groupings of digits as a single number, so while we humans do that intrinsically, for computer use, we typically zero-pad the digits to keep them aligned, and their digit numeric powers consistent without needing to be aware that they even are numbers at all.
ReplyDeleteAs for the main topic of date formats, I agree completely: YMD is in the same order of powers as the digits in our counting system, and is convenient for both numeric sorting (treating the entire date as a single number), and with zero-padding, lexicographical sorting (since the digits occupy a contiguous region of our computing alphabet). Though, we as humans typically deal with near dates, the reverse ordering is usually much more convenient — the same ordering we use in our postal addresses, as a convenient example. But yes, those freaky people over in the US, can't seem to make up their mind — like they start doing it in power order, but were too lazy to include the year, and just kind of tacked it on the end.
With times, as someone with odd sleeping hours, 24-hour time is simply more convenient — I know instantly whether it's morning or evening, without having to look out the window. However, when someone asks me for the time, I still tend to answer as you would reading a regular analog clock: quarter past six, five to noon, that sort of thing.
For more regarding computer alphabet (talking the old fashioned ASCII, not that newer Unicode stuff), the symbols are mostly crammed in wherever there's space around the blocks of alphabetical and numerical digits, which themselves are conveniently aligned on four 5-bit (32-character) "blocks". The two sets of letters, for example, both start at a one-offset within their corresponding character block, meaning you can manipulate the case of alphabetic characters by changing just one bit. Digits are similarly aligned, with '0' being at hexadecimal 30, meaning you can translate digits into their numeric value by simply clipping off all but the lowest four bits. The lowest 32 symbols, are the so-called "control" characters, and map directly to the upper-case 32-character block, again, by just manipulating one of the block selection bits. The first 7 bits, therefore give you a working set of characters, digits, and symbols, plus a bunch of meta-characters which operate as punctuation for the computer.