Java Utililty Methods Year Month

List of utility methods to do Year Month

Description

The list of methods to do Year Month are organized into topic(s).

Method

StringtoDateProgression(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();
...
StringtodaySubtract(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);
...
DatetoYearMonth(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);