- //创建Calendar对象
- Calendar cal = Calendar.getInstance();
- int year = cal.get(Calendar.YEAR);
- int month = (cal.get(Calendar.MONTH))+1;
- int day_of_month = cal.get(Calendar.DAY_OF_MONTH);
- int date = cal.get(Calendar.DATE);
- int hour24 = cal.get(Calendar.HOUR_OF_DAY);
- int hour12 = cal.get(Calendar.HOUR);
- int minute = cal.get(Calendar.MINUTE);
- int second = cal.get(Calendar.SECOND);
- int day_of_week = cal.get(Calendar.DAY_OF_WEEK)-1;
- int ampm = cal.get(Calendar.AM_PM);
- int week_of_year = cal.get(Calendar.WEEK_OF_YEAR);
- int week_of_month = cal.get(Calendar.WEEK_OF_MONTH);
- int day_of_week_in_month = cal.get(Calendar.DAY_OF_WEEK_IN_MONTH);
- int day_of_year = cal.get(Calendar.DAY_OF_YEAR);
posted @
2017-09-17 20:15
柒陆零柒伍伍柒玖零
阅读(
1230)
评论()
编辑
收藏
举报