java - Unparsable Date with colon-separated timezone -


i'm trying parse string

2014-04-04t14:28:38+02:00

it should iso 8601 format. can't parse correct date. i've tried following:

   string example = "2014-04-04t14:28:38+02:00"    public final static simpledateformat df = new simpledateformat("yyyy-mm-dd't'hh:mm:ssz")    date tempdate = df.parse(example) 

but message "unparseable date" can not change example because it's value webservice.

could there probleme "+02:00" instead of "+0200" ?

thanks lot

starting java7, handle +02:00, can use following format:

"yyyy-mm-dd't'hh:mm:ssxxx" 

this can seen in simpledateformat documentation


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -