Skip to main content
Post Made Community Wiki by user7007
Source Link
AnAnswer
  • 424
  • 2
  • 4

ISO 8601 also specifies a syntax for "fuzzy dates". February 12th, 2012 at 3pm would be "2012-02-12T15" and February 2012 could be simply "2012-02". This extends nicely using standard lexicographic sorting:

$ (echo "2013-03"; echo "2013-03"; echo "2012-02-12T15"; echo "2012-02"; echo "2011") | sort 2011 2012 2012-02 2012-02-12T15 2013-03