java - Unparseable date: "2013-07-11T13:41:22.000Z" (at offset 23) -


can tell me why in world got exception?

08-28 08:47:05.246: d/dateparser(4238): string received parsing 2013-08-05t12:13:49.000z

private final static string date_format_pattern = "yyyy-mm-dd't'hh:mm:ss.sssz";   public static date parsedate(string stringtoparse) {         date date = null;         try {             date = new simpledateformat(date_format_pattern).parse(stringtoparse);         } catch (parseexception e) {             logger.logerror(tag, e);         }         return null;     }  08-28 08:47:05.246: e/dateparser(4238): exception: java.text.parseexception: unparseable date: "2013-08-05t12:13:49.000z" (at offset 23) 

try using

string date_format_pattern = "yyyy-mm-dd't'hh:mm:ss.sss'z'" 

the z @ end timezone offset. if you don't need maybe can drop on both sides.


Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -