This trivial code snippet appears to achieve some of its design goals, though there are some aspects worth discussing.
ShipThe YDM vs YMD formatting convention needs to be worked out prior to deploying in production. At a minimum we need a comment explaining the situation (preferably a test which throws fatal error if it sees unexpected default date format), plus adequate unit tests. The "break out an IN_RANGE() helper" item would fit in perfectly with unit tests.