用于微信商家券的Java的日期处理类

微信卡券 java 文章 2020-07-28 17:22 845 0 全屏看文

AI助手支持GPT4.0

不得不说微信商家券的日期很奇葩 都这样的

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;
	}

运行结果:

image.png

-EOF-

AI助手支持GPT4.0


您还可能感兴趣的文章