其它: A、查今天是 "本月" 的第几周 SELECT TO_CHAR(SYSDATE,'WW') - TO_CHAR(TRUNC(SYSDATE,'MM'),'WW') + 1 AS "weekOfMon" from dual; 或 SELECT TO_CHAR(SYSDATE,'W') AS "weekOfMon" from dual; B、查今天是 "今年" 的第几周 select to_char(sysdate,'ww') from dual; 或 select to_char(sysdate,'iw') from dual; 统计哪年哪个星期的哪一天:
复制代码 代码如下:
int year=2011; int week=1; Calendar calFirstDayOfTheYear = new GregorianCalendar(year, Calendar.JANUARY, 1); calFirstDayOfTheYear.add(Calendar.DATE, 7 * (week-1));
int dayOfWeek = calFirstDayOfTheYear.get(Calendar.DAY_OF_WEEK);