Date Comparison
Jan 24, 2003 5:01 PM
Tags: programming
Tags: programming
Random programming tip of the day:
How to compare two dates in any language:
Put them into strings in YYYY-MM-DD format. Compare the two strings. The lesser string is the earlier of the two dates.
Of course, you may want to use a Date object, and converting it to said format may be a pain in the arse.
NOTE: It is important that you keep months and days as two characters. For example, July 4, 2003 should be represented as 2003-07-04, and not as 2003-7-4.
This blog is no longer active, and comments have been disabled.