Three possible explanations:
- Your default locale is incompatible with the input date - for example. he cannot understand
Sephow the name of the month - something is wrong with the input line, or
t- this is the wrong type (for example, java.sql.Dateinstead of java.util.Dateor generally some other type) or not declared.
, , , Locale.
SimpleDateFormat ft = new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a", Locale.US);
java.util.Date t=ft.parse("Sep 16, 2015 10:34:23 AM");
ft.applyPattern("MM.dd");
System.out.println(ft.format(t));
:
09.16