我有字符串11/08/2013 08:48:10
Android的解析字符串的日期時間的SimpleDateFormat
我用SimpleDateFormat("MM/dd/yyyy HH:mm:ss")
,當IM解析它拋出一個異常:無法解析的日期
有什麼錯呢?
String result = han.ExecuteUrl("http://"+han.IP+":8015/api/Values/GetLastChange");
Log.d("Dal","result date time "+result); #result is 11/08/2013 08:48:10
SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
Date convertedDate = new Date();
try
{
convertedDate = dateFormat.parse(result);
}
catch (ParseException e)
{
e.printStackTrace();
}
可以顯示代碼 –
完成。漢變量只是爲了從url返回結果,它返回日期 – user2953680