复制代码 代码如下:
select to_char(sysdate,'ww') ,to_char(sysdate,'iw') from dual;
select to_char(sysdate,'ddd') from dual;
select TRUNC(SYSDATE,'MM') from dual;1)
复制代码 代码如下:
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);
Calendar calFirstDayInWeek = (Calendar)calFirstDayOfTheYear.clone();
calFirstDayInWeek.add(Calendar.DATE,
calFirstDayOfTheYear.getActualMinimum(Calendar.DAY_OF_WEEK) - dayOfWeek);
Date firstDayInWeek = calFirstDayInWeek.getTime();
System.out.println(year + "年第" + week + "个礼拜的第一天是" + ReportDateUtil.getFromatDay().format(firstDayInWeek));
Calendar calLastDayInWeek = (Calendar)calFirstDayOfTheYear.clone();
calLastDayInWeek.add(Calendar.DATE,
calFirstDayOfTheYear.getActualMaximum(Calendar.DAY_OF_WEEK) - dayOfWeek);
Date lastDayInWeek = calLastDayInWeek.getTime();
System.out.println(year + "年第" + week + "个礼拜的最后一天是" + ReportDateUtil.getFromatDay().format(lastDayInWeek));
新闻热点
疑难解答