Reputation: 31
I had a String of a date like that : 27/8/2019 14:6
I try to parse it using SimpleDateFormat but it gives me this error Unparseable date
this is my code :
SimpleDateFormat spf = new SimpleDateFormat("dd MMM HH:mm a");
Date endDate = spf.parse(new_event_finish_date_value.getText().toString());
spf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
String endDate_value = spf.format(endDate);
//what I'm looking for : 2019-08-31T19:30:45+0200
Upvotes: 0
Views: 71
Reputation: 7209
change your input format to this
SimpleDateFormat spf = new SimpleDateFormat("dd/MM/yyyy HH:mm");
Upvotes: 3