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 -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -