android - Error to parse date: "Unparseable date: "Jue 28-05-2016 22:30" (at offset 0)" -


i'm new in android , want parse string date convert calendar object , send android calendar. string value jue 28-05-2015 22:30 (jue jueves, thursday in spanish) , code looks this:

    fechaevento = calendar.getinstance();     begintime ="jue 28-05-2016 22:30"      final simpledateformat sdf = new simpledateformat("eee dd-mm-yyyy kk:mm");      btncalendar.setonclicklistener(new view.onclicklistener() {         @override         public void onclick(view v) {              try {                 fechaevento.settime(sdf.parse(begintime));                 intent intent = new intent(intent.action_insert)                         .setdata(calendarcontract.events.content_uri)                         .putextra(calendarcontract.extra_event_begin_time, fechaevento.gettimeinmillis())                         .putextra(calendarcontract.events.title, nameevento.gettext().tostring())                         .putextra(calendarcontract.events.description, descriptionevento.gettext().tostring());                 startactivity(intent);             } catch (parseexception e) {                 //e.printstacktrace();                 log.i("fecha_m", e.getmessage());             }         }     }); 

when try run error: unparseable date: "jue 28-05-2016 22:30" (at offset 0)

pass spanish locale date formatter:

final simpledateformat sdf =      new simpledateformat("eee dd-mm-yyyy kk:mm", new locale("es")); 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

wso2esb - How to concatenate JSON array values in WSO2 ESB? -