I want to parse the date "3/27/11" which I think is equal to US short date.
DateFormat df1 = new SimpleDateFormat("MM/dd/yy");
DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd");
Date date = (Date) df1.parseObject("03/27/11");
System.out.println("New date: " + df2.format(date));
I found the code above in several java tutorials but it doesn't seem to work. For some how I get,
Exception in thread "main" java.lang.AssertionError: Default directory must be absolute/non-UNC
Here is what I want to achieve,
input: 3/27/11
(03/27/11 should also be a valid input)
output: 2011-03-27
Thanks in advance!