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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -