Take the 2-minute tour ×  This question already has an answer
here:  April 9, 2012 can be written in any of these ways:  4 9
12 4 9 2012 4 09 2012 (I think you get the point)  For those of
you that don't understand, the rules are:  1. Dates may or may
not have ` `, `-` or `/` between them 2. The year can be written
as 2 digits (assumed to be dates in the range of [2000, 2099]
inclusive) or 4 digits 3. One digit month/days may or may not
have leading zeroes.  How would you go about problem solving
this to format the dates into 04/09/12?  I know the dates can be
ambiguous, i.e., 12112 can be 12/1/12 or 1/21/12, but assume the
smallest month possible.  share|improve this question  marked as
duplicate by Sinan Ünür, gpojd, ikegami, AD7six, Jack Maney Mar
13 '13 at 21:10   I presume your question is about how to parse
dates that could be in any of the formats you've given? –  lxop
Mar 13 '13 at 20:17 No, don't do this without modules. –  mob
Mar 13 '13 at 20:25 Would "11113" be 11-1-2013 or 1-11-2013? – 
gpojd Mar