不得不说微信商家券的日期很奇葩 都这样的
2015-05-20T13:29:35+08:00
一般的日期处理类都处理不了。只好自己写了。
代码如下:
public static Date parseDateString2DateWithTimeZone(String s) { Date dateValue =new Date(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss+SSS"); try { dateValue = simpleDateFormat.parse(s); } catch (Exception e) { e.printStackTrace(); } return dateValue; }
运行结果: