Calendar类。Field Summary
static int AM
Value of the AM_PM field indicating the period of the day from midnight to just before noon.
static int AM_PM
Field number for get and set indicating whether the HOUR is before or after noon.
static int APRIL
Value of the MONTH field indicating the fourth month of the year.
protected boolean areFieldsSet
True if fields[] are in sync with the currently set time.
static int AUGUST
Value of the MONTH field indicating the eighth month of the year.
static int DATE
Field number for get and set indicating the day of the month.
static int DAY_OF_MONTH
Field number for get and set indicating the day of the month.
static int DAY_OF_WEEK
Field number for get and set indicating the day of the week.
static int DAY_OF_WEEK_IN_MONTH
Field number for get and set indicating the ordinal number of the day of the week within the current month.
static int DAY_OF_YEAR
Field number for get and set indicating the day number within the current year.
static int DECEMBER
Value of the MONTH field indicating the twelfth month of the year.
static int DST_OFFSET
Field number for get and set indicating the daylight savings offset in milliseconds.
static int ERA
Field number for get and set indicating the era, e.g., AD or BC in the Julian calendar.
static int FEBRUARY
Value of the MONTH field indicating the second month of the year.
static int FIELD_COUNT
The number of distict fields recognized by get and set.
protected int[] fields
The field values for the currently set time for this calendar.
static int FRIDAY
Value of the DAY_OF_WEEK field indicating Friday.
static int HOUR
Field number for get and set indicating the hour of the morning or afternoon.
static int HOUR_OF_DAY
Field number for get and set indicating the hour of the day.
protected boolean[] isSet
The flags which tell if a specified time field for the calendar is set.
protected boolean isTimeSet
True if then the value of time is valid.
static int JANUARY
Value of the MONTH field indicating the first month of the year.
static int JULY
Value of the MONTH field indicating the seventh month of the year.
static int JUNE
Value of the MONTH field indicating the sixth month of the year.
static int MARCH
Value of the MONTH field indicating the third month of the year.
static int MAY
Value of the MONTH field indicating the fifth month of the year.
static int MILLISECOND
Field number for get and set indicating the millisecond within the second.
static int MINUTE
Field number for get and set indicating the minute within the hour.
static int MONDAY
Value of the DAY_OF_WEEK field indicating Monday.
static int MONTH
Field number for get and set indicating the month.
static int NOVEMBER
Value of the MONTH field indicating the eleventh month of the year.
static int OCTOBER
Value of the MONTH field indicating the tenth month of the year.
static int PM
Value of the AM_PM field indicating the period of the day from noon to just before midnight.
static int SATURDAY
Value of the DAY_OF_WEEK field indicating Saturday.
static int SECOND
Field number for get and set indicating the second within the minute.
static int SEPTEMBER
Value of the MONTH field indicating the ninth month of the year.
static int SUNDAY
Value of the DAY_OF_WEEK field indicating Sunday.
static int THURSDAY
Value of the DAY_OF_WEEK field indicating Thursday.
protected long time
The currently set time for this calendar, expressed in milliseconds after January 1, 1970, 0:00:00 GMT.
static int TUESDAY
Value of the DAY_OF_WEEK field indicating Tuesday.
static int UNDECIMBER
Value of the MONTH field indicating the thirteenth month of the year.
static int WEDNESDAY
Value of the DAY_OF_WEEK field indicating Wednesday.
static int WEEK_OF_MONTH
Field number for get and set indicating the week number within the current month.
static int WEEK_OF_YEAR
Field number for get and set indicating the week number within the current year.
static int YEAR
Field number for get and set indicating the year.
static int ZONE_OFFSET
Field number for get and set indicating the raw offset from GMT in milliseconds.
static int AM
Value of the AM_PM field indicating the period of the day from midnight to just before noon.
static int AM_PM
Field number for get and set indicating whether the HOUR is before or after noon.
static int APRIL
Value of the MONTH field indicating the fourth month of the year.
protected boolean areFieldsSet
True if fields[] are in sync with the currently set time.
static int AUGUST
Value of the MONTH field indicating the eighth month of the year.
static int DATE
Field number for get and set indicating the day of the month.
static int DAY_OF_MONTH
Field number for get and set indicating the day of the month.
static int DAY_OF_WEEK
Field number for get and set indicating the day of the week.
static int DAY_OF_WEEK_IN_MONTH
Field number for get and set indicating the ordinal number of the day of the week within the current month.
static int DAY_OF_YEAR
Field number for get and set indicating the day number within the current year.
static int DECEMBER
Value of the MONTH field indicating the twelfth month of the year.
static int DST_OFFSET
Field number for get and set indicating the daylight savings offset in milliseconds.
static int ERA
Field number for get and set indicating the era, e.g., AD or BC in the Julian calendar.
static int FEBRUARY
Value of the MONTH field indicating the second month of the year.
static int FIELD_COUNT
The number of distict fields recognized by get and set.
protected int[] fields
The field values for the currently set time for this calendar.
static int FRIDAY
Value of the DAY_OF_WEEK field indicating Friday.
static int HOUR
Field number for get and set indicating the hour of the morning or afternoon.
static int HOUR_OF_DAY
Field number for get and set indicating the hour of the day.
protected boolean[] isSet
The flags which tell if a specified time field for the calendar is set.
protected boolean isTimeSet
True if then the value of time is valid.
static int JANUARY
Value of the MONTH field indicating the first month of the year.
static int JULY
Value of the MONTH field indicating the seventh month of the year.
static int JUNE
Value of the MONTH field indicating the sixth month of the year.
static int MARCH
Value of the MONTH field indicating the third month of the year.
static int MAY
Value of the MONTH field indicating the fifth month of the year.
static int MILLISECOND
Field number for get and set indicating the millisecond within the second.
static int MINUTE
Field number for get and set indicating the minute within the hour.
static int MONDAY
Value of the DAY_OF_WEEK field indicating Monday.
static int MONTH
Field number for get and set indicating the month.
static int NOVEMBER
Value of the MONTH field indicating the eleventh month of the year.
static int OCTOBER
Value of the MONTH field indicating the tenth month of the year.
static int PM
Value of the AM_PM field indicating the period of the day from noon to just before midnight.
static int SATURDAY
Value of the DAY_OF_WEEK field indicating Saturday.
static int SECOND
Field number for get and set indicating the second within the minute.
static int SEPTEMBER
Value of the MONTH field indicating the ninth month of the year.
static int SUNDAY
Value of the DAY_OF_WEEK field indicating Sunday.
static int THURSDAY
Value of the DAY_OF_WEEK field indicating Thursday.
protected long time
The currently set time for this calendar, expressed in milliseconds after January 1, 1970, 0:00:00 GMT.
static int TUESDAY
Value of the DAY_OF_WEEK field indicating Tuesday.
static int UNDECIMBER
Value of the MONTH field indicating the thirteenth month of the year.
static int WEDNESDAY
Value of the DAY_OF_WEEK field indicating Wednesday.
static int WEEK_OF_MONTH
Field number for get and set indicating the week number within the current month.
static int WEEK_OF_YEAR
Field number for get and set indicating the week number within the current year.
static int YEAR
Field number for get and set indicating the year.
static int ZONE_OFFSET
Field number for get and set indicating the raw offset from GMT in milliseconds.
我先SET了,年,月,周。应如何取得。
Calendar cd = Calendar.getInstance();
cd.set(cd.YEAR,2001);
cd.set(cd.MONTH,10);
cd.set(cd.WEEK_OF_MONTH,5);DATE的取值不正确。
交个朋友
我的是1818477
[email protected]