0
嗨我想解析一個字符串到日期,但它是拋出異常java.text.ParseException: Unparseable date: "1409239380000" (at offset 13)
。這裏是我的代碼:ParseException解析字符串日期
String text="1409239380000";
try{
SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date1=dateFormat.parse(text);
}catch(Exception e){
Log.e("Error final:", e.toString());
}
那麼,'1409239380000'確實不遵循格式'yyyy-MM-dd HH:mm:ss' ... – Keppil 2014-08-29 12:43:37
我知道它,但我不知道如何將格式更改爲我擁有的格式。 – temerariomalaga 2014-08-29 12:44:57
'1409239380000'是'Unparseable date',因此是'ParseException'。現在你的問題是什麼? – Unihedron 2014-08-29 12:45:16