1. Calendar()的常用方法:
方法名 | 说明 |
static Calendar getInstance() | 使用默认时区和区域获取日历 |
void set(int year,int month,int date,int hourofday,int minute,int second) | 设置日历的年、月、日、时、分、秒。 |
void set(int year, int month,int date) | 设置日历字段YEAR、MONTH和DAY_OF_MONTH的值 |
int get(int field) | 返回给定日历字段的值。字段比如年、月、日等 |
void setTime(Date date) | 用给定的Date设置此日历 |