类似2018-11-07T04:38:46.000+0000格式的时间格式化
import java.text.SimpleDateFormat;
import java.text.DateFormat;
public static String parseDate(String dateStr) throws ParseException {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.SSSZ");
Date result;
result = df.parse(dateStr);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
return sdf.format(result);
}
posted on 2018-11-07 16:29 Happy_wuwy 阅读(125) 评论(0) 收藏 举报
浙公网安备 33010602011771号