List of utility methods to do Year Day
int | getYearWeek(String curday) get Year Week try { java.util.Date date = str2date(curday); Calendar rightNow = Calendar.getInstance(); rightNow.setTime(date); return rightNow.get(Calendar.WEEK_OF_YEAR); } catch (Exception e) { e.printStackTrace(); return 0; ... |
int | getYearWeek(String curday) get Year Week try { java.util.Date date = str2utilDate(curday); Calendar rightNow = Calendar.getInstance(); rightNow.setTime(date); return rightNow.get(Calendar.WEEK_OF_YEAR); } catch (Exception e) { System.out.println("DateUtil.getYearWeek(str) Error:e = " + e); return 0; ... |
int | lastDay(Integer year, int month) last Day Calendar cal = Calendar.getInstance();
cal.set(year, month - 1, 1);
cal.add(Calendar.MONTH, 1);
cal.add(Calendar.DATE, -1);
return cal.get(Calendar.DAY_OF_MONTH);
|
String | lastdayofyear() lastdayofyear SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); String year = sdf.format(new java.util.Date()); return year + "-12-31"; |
Date | lastDayOfYear(Integer year) last Day Of Year Date d = new Date(); d.setMonth(11); d.setYear(year - 1900); d.setHours(23); d.setMinutes(59); Calendar calendar = Calendar.getInstance(); calendar.setTime(d); int lastDate = calendar.getActualMaximum(Calendar.DATE); ... |
String | todaysYear() todays Year DateFormat nuSE = new SimpleDateFormat("yyyy"); return nuSE.format(new Date()); |