java.text.ParseException:无法解析的日期" yyyy-MM-dd' T' HH:mm:ss.SSSZ& quot; -SimpleDateFormat [英] java.text.ParseException: Unparseable date "yyyy-MM-dd'T'HH:mm:ss.SSSZ" - SimpleDateFormat
本文介绍了java.text.ParseException:无法解析的日期" yyyy-MM-dd' T' HH:mm:ss.SSSZ& quot; -SimpleDateFormat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果能找到有关此异常的错误的帮助,我们将不胜感激:
I would appreciate any help with finding bug for this exception:
java.text.ParseException: Unparseable date: "2007-09-25T15:40:51.0000000Z"
和以下代码:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
Date date = sdf.parse(timeValue);
long mills = date.getTime();
this.point.time = String.valueOf(mills);
它用Date date = sdf.parse(timeValue);
引发征兆.
timeValue = "2007-09-25T15:40:51.0000000Z";
,例外.
谢谢.
推荐答案
Z
表示时区字符.它需要被引用:
Z
represents the timezone character. It needs to be quoted:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
这篇关于java.text.ParseException:无法解析的日期" yyyy-MM-dd' T' HH:mm:ss.SSSZ& quot; -SimpleDateFormat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文