java - Parse Date, SimpleXML, Android -


i use simple-xml in android, , date in follow format "2013-05-13+02:00", try date in string format, after can't parse date in format!

private date modifydatelayout(string inputdate){      simpledateformat  format = new simpledateformat("yyyy-mm-dd hh:mm");       try {           date date = format.parse(inputdate);           log.i("date: ", date.tostring());         return date;     } catch (parseexception e) {           log.i("error parseexception : ", e.tostring());         return null;     } } 

i error :

java.text.parseexception: unparseable date: "2013-05-13+02:00" 

try doing this:

private date modifydatelayout(string inputdate){      simpledateformat  format = new simpledateformat("yyyy-mm-dd+hh:mm");       try {           date date = format.parse(inputdate);           log.i("date: ", date.tostring());         return date;     } catch (parseexception e) {           log.i("error parseexception : ", e.tostring());         return null;     } } 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -