I am trying to format text into a date. Here is what I have:
String pattern = "yyyy.MM.dd";
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
Date d=sdf.parse("12.1.5");
I get:
java.lang.IllegalArgumentException: Illegal pattern character 'Y'
at this point.
I have also tried using a ParsePosition as well as "2012.01.05". Same error.
How can I parse this string into a date? Any optional ways? What am I missing?
Thanks,