List of utility methods to do Year Month
String | toDateProgression(int year, int month, int day, String seed, int pedometer) to Date Progression GregorianCalendar dateAntetype = new GregorianCalendar(year, month - 1, day); if ("year".equals(seed)) dateAntetype.add(GregorianCalendar.YEAR, pedometer); else if ("month".equals(seed)) dateAntetype.add(GregorianCalendar.MONTH, pedometer); else if ("day".equals(seed)) dateAntetype.add(GregorianCalendar.DATE, pedometer); Date d = dateAntetype.getTime(); ... |
String | todaySubtract(String years, String months) today Subtract Calendar cal = Calendar.getInstance(); int yy = 0, mm = 0, dd = 0; try { if (years != null && !years.equals("0")) { yy = Integer.parseInt(years); if (months != null && !months.equals("0")) { mm = Integer.parseInt(months); ... |
Date | toYearMonth(String dateString) to Year Month if (Strings.isNullOrEmpty(dateString)) { return null; try { return YEAR_MONTH_FORMAT.parse(dateString); } catch (ParseException e) { throw new RuntimeException(e); |