img
Method
Description
int get(int calendarField)
Returns the value of one component of the invoking
object. The component is indicated by calendarField.
Examples of the components that can be requested
are Calendar.YEAR, Calendar.MONTH,
Calendar.MINUTE, and so for th.
static Locale[ ] getAvailableLocales( )
Returns an array of Locale objects that contains
the locales for which calendars are available.
static Calendar getInstance( )
Returns a Calendar object for the default locale and
time zone.
static Calendar getInstance(TimeZone tz)
Returns a Calendar object for the time zone
specified by tz. The default locale is used.
static Calendar getInstance(Locale locale)
Returns a Calendar object for the locale specified
by locale. The default time zone is used.
static Calendar getInstance(TimeZone tz,
Returns a Calendar object for the time zone
Locale locale)
specified by tz and the locale specified by locale.
final Date getTime( )
Returns a Date object equivalent to the time of the
invoking object.
TimeZone getTimeZone( )
Returns the time zone for the invoking object.
final boolean isSet(int which)
Returns true if the specified time component is set.
Other wise, it returns false.
void set(int which, int val)
Sets the date or time component specified by which
to the value specified by val in the invoking object.
which must be one of the fields defined by
Calendar, such as Calendar.HOUR.
final void set(int year, int month,
Sets various date and time components of the
int dayOfMonth)
invoking object.
final void set(int year, int month,
Sets various date and time components of the
int dayOfMonth, int hours,
invoking object.
int minutes)
final void set(int year, int month,
Sets various date and time components of the
int dayOfMonth, int hours,
invoking object.
int minutes, int seconds)
final void setTime(Date d)
Sets various date and time components of the
invoking object. This information is obtained from
the Date object d.
void setTimeZone(TimeZone tz)
Sets the time zone for the invoking object to that
specified by tz.
TABLE 18-4
Commonly Used Methods Defined by Calendar (continued)
Calendar defines the following int constants, which are used when you get or set
components of the calendar:
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks
Home