Monthly Archives: August 2015

Curse of the Dreaded Dates

As an undergraduate, I was given a Bash assignment and one of the sub-tasks was to sort some .csv file by date. It took me two weeks to realise that the way we, as British humans, format the date (dd-mm-yyyy) is utterly useless to sort with and simply reversing the date (to yyyy-mm-dd) and treating it as a numerical type (example, 20150810) would guarantee an easy way to sort. It later transpired that formatting dates to yyyy-mm-dd is an ISO standard and what you should be doing when working with dates on computers and whatnot. At the time, though, my undergraduate mind was overjoyed that I managed to solve what was a tricky problem.

Given that previous lesson, you really would have thought that an experienced Joe, having already world exclusively solved the date sorting problem for the standards committees, would not be naive enough to use dates that follow dd-mm-yyyy format when programming.  Well…

Continue reading