例子
1.如:/Date(1587696591000+0800)/ (多了毫秒)
2.如:/Date(1587696591000)/
转换(Java)
String time="/Date(1587696591000+0800)/";
//情况二length()-7
//情况一length()-2
String newStr = time.substring(time.indexOf('(')+1,time.length()-7);
Date date = new Date(Long.valueOf(newStr));
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String CorrectTime=formatter.format(date);
参考
陈器 2020.4.25
本文详细介绍了如何在Java中处理和转换JSON中的日期格式,包括去除毫秒和时区偏移,通过示例代码展示了从JSON字符串转换为Java Date对象的方法,并使用SimpleDateFormat进行格式化。
6972

被折叠的 条评论
为什么被折叠?



