我有一个日期字符串:
Thu Feb 20 08:00:00 EET 1992
并使用此代码对其进行格式化:
String datePatternFrom = "EEE MMM dd HH:mm:ss ZZZ yyyy";
String datePatternTo = "MMM dd, yyyy";
String prettyDate = "";
try {
DateFormat fromFormatter = new SimpleDateFormat(datePatternFrom);
Date date = (Date)fromFormatter.parse(userBirthday.toString());
DateFormat toFormatter = new SimpleDateFormat(datePatternTo);
prettyDate = toFormatter.format(date);
} catch (ParseException e) {
e.printStackTrace();
}
为什么我得到例外?
java.text.ParseException: Unparseable date: "Thu Feb 20 08:00:00 EET 1992" (at offset 0)