/**
* 获取当前年份
*/
public static int getCurrentYear() {
Calendar c = Calendar.getInstance();
return c.get(Calendar.YEAR);
}
/**
* 获取当前月份
*/
public static int getCurrentMonth() {
Calendar c = Calendar.getInstance();
return c.get(Calendar.MONTH) + 1;
}
/**
* 获取当前小时
*/
public static int getCurrentHour() {
Calendar c = Calendar.getInstance();
return c.get(Calendar.HOUR_OF_DAY);
}
/**
* 获取当前日期
*/
public static int getCurrentDay() {
Calendar c = Calendar.getInstance();
return c.get(Calendar.DAY_OF_MONTH);
}
/**
* 获取当前分钟
*/
public static int getCurrentMinute() {
Calendar c = Calendar.getInstance();
return c.get(Calendar.MINUTE);
}
* 获取当前年份
*/
public static int getCurrentYear() {
Calendar c = Calendar.getInstance();
return c.get(Calendar.YEAR);
}
/**
* 获取当前月份
*/
public static int getCurrentMonth() {
Calendar c = Calendar.getInstance();
return c.get(Calendar.MONTH) + 1;
}
/**
* 获取当前小时
*/
public static int getCurrentHour() {
Calendar c = Calendar.getInstance();
return c.get(Calendar.HOUR_OF_DAY);
}
/**
* 获取当前日期
*/
public static int getCurrentDay() {
Calendar c = Calendar.getInstance();
return c.get(Calendar.DAY_OF_MONTH);
}
/**
* 获取当前分钟
*/
public static int getCurrentMinute() {
Calendar c = Calendar.getInstance();
return c.get(Calendar.MINUTE);
}