我有日期格式,"EEE, dd MMM yyyy HH:mm:ss Z"
日期是
String date = "Tue, 14 Aug 2012 07:26:33 +0000";
如何在+0700
不更改日期格式的情况下更改时区?
这就是我尝试的
String sDate = null;
Date date = null;
try {
sDate = "Tue, 14 Aug 2012 07:26:33 +0000";
SimpleDateFormat curFormater = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z");
curFormater.setTimeZone(TimeZone.getTimeZone("GMT"));
try {
date = curFormater.parse(sDate);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (DropboxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
lastUpdate.setText("Last Update : " + date.toString());
但结果是Tue Aug 14 14:26:33 ICT 2012