0
我有以下日期:如何將UTC轉換爲DateTime?
2011-05-24T11:40:41Z
我如何轉換這成喬達日期時間?
編輯: 這裏是我的代碼無法編譯:
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
Date date = df.parse(aMessage.getString("updated_at"));
org.joda.time.DateTime dt = new DateTime(date);
錯誤:
The method parse(String) is undefined for the type DateFormat
Type mismatch: cannot convert from SimpleDateFormat to DateFormat
你能否告訴我這一次的例子嗎? – 2011-05-24 15:44:04
是的,喬達日期時間 – 2011-05-24 15:48:12
我已經更新了答案,告訴你如何:) – 2011-05-24 15:52:50