Java Converting String (Tag/Monat/Jahr) bis heute
Posted: 27 Jan 2025, 05:43
Ich versuche, die Zeichenfolge in ein Datum umzuwandeln
. Warum ist das so? Ich möchte ein Datum für den 31.12.2012
Code: Select all
String date = "12/31/2012";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd");
try {
Date parse = sdf.parse(date);
System.out.println(parse);
} catch (ParseException ex) {
ex.printStackTrace();
}
< /code>
Aber es scheint mir, dass es eine Ausnahme < /code> gibt. von ParseExpception