java.util
Class Calendar

Calendar is an abstract base class for converting between
a Date object and a set of integer fields such as
YEAR, MONTH, DAY, HOUR,
and so on. (A Date object represents a specific instant in
time with millisecond precision. See
Date
for information about the Date class.)

Subclasses of Calendar interpret a Date
according to the rules of a specific calendar system.

Like other locale-sensitive classes, Calendar provides a
class method, getInstance, for getting a generally useful
object of this type.

Calendar rightNow = Calendar.getInstance();

A Calendar object can produce all the time field values
needed to implement the date-time formatting for a particular language
and calendar style (for example, Japanese-Gregorian, Japanese-Traditional).

When computing a Date from time fields,
there may be insufficient information to compute the
Date (such as only year and month but no day in the month).

Insufficient information. The calendar will use default
information to specify the missing fields. This may vary by calendar; for
the Gregorian calendar, the default for a field is the same as that of the
start of the epoch: i.e., YEAR = 1970, MONTH = JANUARY, DATE = 1, etc.
Note: The ambiguity in interpretation of what day midnight
belongs to, is resolved as so: midnight "belongs" to the following day.
23:59 on Dec 31, 1969 < 00:00 on Jan 1, 1970.
12:00 PM is midday, and 12:00 AM is midnight.
11:59 PM on Jan 1 < 12:00 AM on Jan 2 < 12:01 AM on Jan 2.
11:59 AM on Mar 10 < 12:00 PM on Mar 10 < 12:01 PM on Mar 10.
24:00 or greater are invalid.
Hours greater than 12 are invalid in AM/PM mode.
Setting the time will never change the date.

If equivalent times are entered in AM/PM or 24 hour mode, equality will be
determined by the actual time rather than the entered time.

This class has been subset for Java ME based on the JDK 1.3 Calendar class.
Many methods and variables have been pruned, and other methods
simplified, in an effort to reduce the size of this class.

HOUR

public static final int HOUR

Field number for get and set indicating the
hour of the morning or afternoon. HOUR is used for the
12-hour clock (0 - 11). Noon and midnight are represented by 0, not
by 12. E.g., at 10:04:15.250 PM the HOUR is 10.