http://qs321.pair.com?node_id=1150042


in reply to Re: Comparing two dates without installing any modules
in thread Comparing two dates without installing any modules

One could also let the user specify which date format they are using. It may even have field escapes to build a format like the date(1) command. Yet another option is to allow for year, month, and day arguments (-fromday -frommonth -fromyear -tomonth -today -toyear). One could also document ISO 8601 dates are taken by the program and reject anything that isn't one. There might be a Unix epoch timestamp option.

I find it odd that you would call using '-' as a separator an error. ISO 8601 demands it. The standard also works with week numbers and day-of-year numbers which can be quite handy sometimes. When writing new software which doesn't have to deal with legacy formats, I generally try to use a standard. If you're going to force a particular format, don't use one that encourages localization nightmares.