Date values are much more difficult to compare lexicographically, as the formats are so different and there is no guarantee that the significant units will be in the right position in the date string. It is possible to store the date as the number of epoch seconds since January 1, 1970. This will work but is a bit cumbersome, as the stored number is not at all readable and you will need to convert it to another meaningful date format to make any sense of it.
Note
A better solution is to use a date format that is friendly to a lexicographical comparison—ISO8601.
ISO8601 is a format that is also being used by some of the Amazon Web Services. It is an international standard for representing date formats in an unambiguous way while making comparisons between two dates simpler. The date and time values are organized from the most to the least significant components: year, month (or week), day, hour, minute, second, and fraction of second. The time representation possesses a...