Skip to main content

Time and Date formats.

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. -アパゾ

Comments

  1. 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.

    As 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.

    ReplyDelete

Post a Comment

Popular posts from this blog

Quarterly roundup September 2020 *Spoiler Free*

"Hey look", "Those people know writing and stuff", "Listen to them"... These are impressions, not reviews. Titles completed during this period 2020-07-01 to 2020-09-30 2012 (2009) As long as you turn off your brain it's a good fodder movie. The fx really hasn't held up though. 3 Days to Kill (2014) Not great, well not even good. Actually it's below average. Kevin Costner does an alright job but he's just one man, and just one man can't save this film. Sound and Fx are average at best. Avatar (2009) If there is anything going for Avatar, it's that even 11 years later it's still quite visually stunning which isn't to say its vfx are anything to write home about these days. Acting is good I suppose. Sound and music on the other hand, it's done well, like really well. Glory (1989) With Denzel Washington, Morgan Freeman, and Andre Braugher, how could it not be a great film? Not really familiar with US Civil War specifics so c...

Quarterly roundup March 2022 *Spoiler Free*

" To build may have to be the slow and laborious task of years. To destroy can be the thoughtless act of a single day. "   These are impressions, not reviews. Look for someone much more qualified for those. Titles completed during this period 2022-01-01 to 2022-03-31   47 Ronin [2013]  I had heard mixed but generally positive things about this film. Always been a fan of Reanu, and Hiroyuki so finally got around to watching and I like it. Don't think it's as great as The Last Samurai but it's up there for me. Could've been a bit longer though, to flesh out the witch a bit more, and possibly some of the other 47 Ronin. IMHO if you are interested by feudal Japan or the legend of the 47 Ronin, then consider this a must-watch.   Ender's Game [2014]  Went into this one with only my brothers recommendation. It's interesting to say the least.   Forrest Gump [1994] Everyone knows this movie so need I say more?   Saving Private Ryan [1998]   Again, ...