date parsing accepts 05/05/1999 5/5/1999, etc
is there rudimentary proceed parse date competence mm/dd/yyyy, m/d/yyyy, combination? i.e. 0 discretionary before unparalleled number month.
to manually, use:
string[] datefields = datestring.split("/");
int month = integer.parseint(datefields[0]);
int = integer.parseint(datefields[1]);
int year = integer.parseint(datefields[2]);
and countenance with:
datestring.matches("\\d\\d?/\\d\\d?/\\d\\d\\d\\d")
is there simpledateformat jodatime hoop this?
Comments
Post a Comment