【发布时间】:2014-11-11 17:11:41
【问题描述】:
我有个约会,像
datewithGMT >>
Tue Oct 28 07:06:54 GMT+02:00 2014
我想将其重置为
Tue Oct 28 07:06:54 2014
使用以下
SimpleDateFormat df = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss");
df.setTimeZone(TimeZone.getDefault());
Date airDate = null;
try {
airDate = df.parse(datewithGMT);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
我再次获得 +2 GMT 的日期,如何删除这个偏移量
【问题讨论】:
-
您能再解释一下吗?在您的示例中,您似乎刚刚从结尾删除了“2014”。
-
使用 SimpleDateFormat