Ich möchte umwandeln: Wed Apr 06 09:37:00 GMT + 03: 00 2016 bis 02/02/2012. Was ichAndroid Datum zu String Umwandlung Problem
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
Date date = sdf.parse(mydate);
versucht und
String mydate = "Wed Apr 06 09:37:00 GMT+03:00 2016";
SimpleDateFormat src = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzzz yyyy");
SimpleDateFormat dest = new SimpleDateFormat("dd/MM/yyyy");
Date date = null;
try {
date = src.parse(mydate);
} catch (ParseException e) {
Log.d("deneme",e.getMessage());
}
String result = dest.format(date);
aber sein give Fehler unparseable Datum: "Mi 6. April 09.37.00 GMT + 03: 00 2016" (bei Offset 0) eine Idee, wie Ich kann es analysieren?
http://stackoverflow.com/questions/8911099/java-text-parseexception-unparseable-date-thu-jan-19-2012-0800-pm –
@keikoman nimm meinen Code und setze ihn direkt, es wird dir das Ergebnis geben –
@Kelkoman du wandelst dein Datum in Millisekunden und parst sie dann zu deinem gewünschten Format –