class defines methods that perform date and time arithmetic. It also
includes methods that convert dates and times to and from the
machine-usable millisecond format used by the
class and units such as minutes, hours, days, weeks, months, and
years that are more useful to humans. As an abstract class,
Calendar cannot be directly instantiated. Instead,
it provides static
getInstance( ) methods that
return instances of a
Calendar subclass suitable
for use in a specified or default locale with a specified or default
time zone. See also
Calendar defines a number of useful constants.
Some of these are values that represent days of the week and months
of the year. Other constants, such as
DAY_OF_WEEK, represent various fields of date and
time information. These field constants are passed to a number of
Calendar methods, such as
set( ), in order to indicate what
particular date or time field is desired.
setTime( ) and the
set( ) methods set the date represented by
Calendar object. The
method adds (or subtracts) values to a calendar field, incrementing
the next larger field when the field being set rolls over.
roll( ) does the same, without modifying anything
but the specified field.
before( ) and
after( ) compare two
objects. Many of the methods of the
are replacements for methods of
Date that have
been deprecated as of Java 1.1. While the
Calendar class ...