标签:null add time() span pre rda int locale first
public static Date getDayOfWeek(int dayOfWeek,int weekOffset){ if(dayOfWeek>Calendar.SATURDAY || dayOfWeek<Calendar.SUNDAY){ return null; } Calendar date=Calendar.getInstance(Locale.CHINA); //将每周第一天设为星期一,默认是星期天 date.setFirstDayOfWeek(Calendar.MONDAY); //周数减一,即上周 date.add(Calendar.WEEK_OF_MONTH,weekOffset); //日子设为周几 date.set(Calendar.DAY_OF_WEEK, dayOfWeek); //时分秒全部置0 date.set(Calendar.HOUR_OF_DAY, 0); date.set(Calendar.MINUTE, 0); date.set(Calendar.SECOND, 0); date.set(Calendar.MILLISECOND, 0); return date.getTime(); }
标签:null add time() span pre rda int locale first
原文地址:http://www.cnblogs.com/winkey4986/p/7465521.html