List of utility methods to do Day Of Year
Date | getLastYearOfToday() get Last Year Of Today return rollYear(new Date(), -1); |
int | getMaxDayByYearMonth(String ym) get Max Day By Year Month int day = 0; try { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); Calendar calendar = new GregorianCalendar(); Date date = sdf.parse(ym); calendar.setTime(date); day = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); } catch (ParseException e) { ... |
String | getMaxDayOfYearMonth(String date) get Max Day Of Year Month SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); try { Date d = sdf.parse(date); Calendar calendar = Calendar.getInstance(); calendar.setTime(d); int lastDayNum = calendar.getActualMaximum(Calendar.DAY_OF_MONTH); date = date + "-" + lastDayNum; } catch (ParseException e) { ... |
int | getMaxWeekNumOfYear(int year) get Max Week Num Of Year Calendar c = new GregorianCalendar(); c.set(year, Calendar.DECEMBER, 31, 23, 59, 59); return getWeekOfYear(c.getTime()); |