|
|
|
怎么得到指定日期是星期几啊?
|
2004年07月25日 14:13
|
|
|
标签列表
|
|
java.util.Calendar c= java.util.Calendar.getInstance(); c.set(2004,6,28); System.out.println(c.get(Calendar.DAY_OF_WEEK)); 怎么老返回的跟实际对不上啊,各位帮忙看看
|
|
|
|
|
|
Re: 怎么得到指定日期是星期几啊?
|
2004年07月25日 14:19
|
|
|
java.util.Calendar c= java.util.Calendar.getInstance(); c.set(2004,7,25); System.out.println(c.get(c.DAY_OF_WEEK)); 比如这个应该返回星期日,也就是7,我这里总是返回4。郁闷啊。
|
|
|
|
|
|
Re: 怎么得到指定日期是星期几啊?
|
2004年07月26日 08:38
|
|
|
jdk的文档指明: month - the value used to set the MONTH time field. Month value is 0-based. e.g., 0 for January 月是以0开始的. 所以你指定的7实际是8月了
|
|
|
|