我的问题可以通过以下场景轻松创建:
//create a gregorian calendar object that set the date and time as 4th June 2012 at 10:30PM
Calendar calendar = new GregorianCalendar(2012, 6, 4, 22, 30);
//when I print out these:
System.out.println(calendar.get(Calendar.DAY_OF_WEEK));
System.out.println(calendar.get(Calendar.MINUTE));
System.out.println(calendar.get(Calendar.HOUR));
System.out.println(calendar.get(Calendar.DATE));
System.out.println(calendar.get(Calendar.MONTH));
System.out.println(calendar.get(Calendar.YEAR));
//output reads as:
4
30
10
4
6
2012
//so does calendar.get(Calendar.DAY_OF_WEEK) == calendar.get(Calendar.DATE) ???
为了让每个人都清楚 2012 年 6 月 4 日是星期一,那么 calendar.get(Calendar.DAY_OF_WEEK) 不应该在一周的第一天返回 0 吗?
感谢您的所有帮助和关注,还请验证您所指的来源。
用户1442080