private static int daysInMonth()

in core/src/main/java/org/apache/calcite/avatica/util/DateTimeUtils.java [762:781]


  private static int daysInMonth(int year, int month) {
    switch (month) {
    case 9:
    case 4:
    case 6:
    case 11:
        // Thirty days hath September,
        // April, June, and November,
      return 30;

    default:
      // All the rest have thirty-one,
      return 31;

    case 2:
      // Except February, twenty-eight days clear,
      // And twenty-nine in each leap year.
      return isLeapYear(year) ? 29 : 28;
    }
  }