parsing - java.text.ParseException: Unparseable date "yyyy-MM-dd'T'HH:mm:ss.SSSZ" - SimpleDateFormat -
i appreciate finding bug exception:
java.text.parseexception: unparseable date: "2007-09-25t15:40:51.0000000z"
and following code:
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);
it throws expcetion date date = sdf.parse(timevalue);
.
timevalue = "2007-09-25t15:40:51.0000000z";
, in exception.
thanks.
z
represents timezone character. needs quoted:
simpledateformat sdf = new simpledateformat("yyyy-mm-dd't'hh:mm:ss.sss'z'");
Comments
Post a Comment