I'm new in Android and Java development.
I have this day type "Fri Jan 27 00:00:00 GMT+00:00 1995"
. <-- (input)
I want to get "1995/27/01"
<-- (output)
I'm using this code :
String inputPattern = "EEE MMM dd HH:mm:ss z yyyy";
String outputPattern = "yyyy-MM-dd";
SimpleDateFormat inputFormat = new SimpleDateFormat(inputPattern);
SimpleDateFormat outputFormat = new SimpleDateFormat(outputPattern);
Date date = inputFormat.parse("Fri Jan 27 00:00:00 GMT+00:00 1995");
String str = outputFormat.format(date);
but I get a ParseException
.
Any idea why?