Calendar: bin ich meiner Zeit voraus?

Hallo Leute!

Zur Überprüfung der Aktualität eines eingegebenen Datums vergleiche
ich dieses Datum mit einem Calendar-Objekt, das ich folgendermaßen
erstelle:

Calendar today = Calendar.getInstance ();

Aber irgendwie liefert der mir beim Wert MONTH eine 3 anstatt eine 4.
Ist das standardmäßig so und muss ich da einfach noch eins dazu
zählen oder läuft da bei mir was verkehrt?

Gruß

Edi

Ist das standardmäßig so und muss ich da einfach noch eins
dazu zählen

Genau.

„the first month of the year has value MONTH == JANUARY“
„public static final int JANUARY 0“

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Ca…
http://java.sun.com/j2se/1.4.2/docs/api/constant-val…

Gruss, Patrick

Schau dir doch mal die API Doku an. Da steht für MONTH:

Field number for get and set indicating the month. This is a calendar-specific value. The first month of the year is JANUARY which is 0; the last depends on the number of months in a year.

/Dirk

[Bei dieser Antwort wurde das Vollzitat nachträglich automatisiert entfernt]

Danke euch
Ok hätte ich vielleicht nochmal genauer nachlesen sollen.

Danke Euch trotzdem!

Gruß

Edi