dd/mm/yyyy vs dd/MM/yyyy?

SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
        String date = sdf.format(new Date()); 
        System.out.println(date); 

Ergebnis ist das heutige Datum ich.e 23/03/2014

Aber wenn ich das mache

 SimpleDateFormat sdf = new SimpleDateFormat("dd/mm/yyyy"); 

Ergebnis kann 23/05/2014, 23/05/2014, 23/06/2014 und Sohn mit jedem Lauf prgram. Warum ist das so?

Ein Blick in die javadoc : docs.oracle.com/javase/7/docs/api/java/text/...
Wenn Sie besonders Pech haben, könnten die Ergebnisse auch 23/59/2014.

InformationsquelleAutor user3198603 | 2014-03-23

Schreibe einen Kommentar