cdm/src/main/java/ucar/nc2/time/CalendarDate.java
public CalendarDate add(CalendarPeriod period) {
    switch (period.getField()) {
      case Millisec:
        return new CalendarDate(cal, dateTime.plusMillis(period.getValue()));
      case Second:
        return new CalendarDate(cal, dateTime.plusSeconds(period.getValue()));
      case Minute:
        return new CalendarDate(cal, dateTime.plusMinutes(period.getValue()));
      case Hour:
        return new CalendarDate(cal, dateTime.plusHours(period.getValue()));
      case Day:
        return new CalendarDate(cal, dateTime.plusDays(period.getValue()));
      case Month:
        return new CalendarDate(cal, dateTime.plusMonths(period.getValue()));
      case Year:
        return new CalendarDate(cal, dateTime.plusYears(period.getValue()));
    }
    throw new UnsupportedOperationException("period units = "+period);
  }
public CalendarDate add(CalendarPeriod period) {
    switch (period.getField()) {
      case Millisec:
        return new CalendarDate(cal, dateTime.plusMillis(period.getValue()));
      case Second:
        return new CalendarDate(cal, dateTime.plusSeconds(period.getValue()));
      case Minute:
        return new CalendarDate(cal, dateTime.plusMinutes(period.getValue()));
      case Hour:
        return new CalendarDate(cal, dateTime.plusHours(period.getValue()));
      case Day:
        return new CalendarDate(cal, dateTime.plusDays(period.getValue()));
      case Month:
        return new CalendarDate(cal, dateTime.plusMonths(period.getValue()));
      case Year:
        return new CalendarDate(cal, dateTime.plusYears(period.getValue()));
    }
    throw new UnsupportedOperationException("period units = "+period);
  }
calendar date field