Someone is going to inevitably mention this, so it might as well be me: why not just use (Simple)DateFormat?
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Joined: Oct 28, 2011
I'm planning to write generic class to validate any date format and DATE_PATTERN regex will be passed to validate method based on date format.
By using DateFormat, if parse (date format yyyymmdd) I will get but which is wrong date(month is wrong).