Page 1 of 1

MONATE NAME WITH SimpledateFormat falsch machen

Posted: 08 Feb 2025, 03:44
by Guest
Ich habe ein Problem mit diesem kleinen Code < /p>

SimpleDateFormat sf = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss");

String str = "2010-03-13 01:01:22";

Date date = sf.parse(str);

SimpleDateFormat f = new SimpleDateFormat("d MMM yyyy hh:mm aaa");

System.out.println(" Date " + f.format(date));
< /code>

Ausgabe: < /p>

Date 13 Jan 2010 01:01 AM
< /code>

Der Code scheint in Ordnung zu sein, aber ich bekomme immer noch den Monatsnamen falsch.>