Enum Month

All Implemented Interfaces:
Comparable<Month>, TemporalAccessor

public enum Month extends Enum<Month> implements TemporalAccessor
The twelve months of the ISO calendar.
  • Enum Constant Details

    • JANUARY

      public static final Month JANUARY
      January, month 1.
    • FEBRUARY

      public static final Month FEBRUARY
      February, month 2.
    • MARCH

      public static final Month MARCH
      March, month 3.
    • APRIL

      public static final Month APRIL
      April, month 4.
    • MAY

      public static final Month MAY
      May, month 5.
    • JUNE

      public static final Month JUNE
      June, month 6.
    • JULY

      public static final Month JULY
      July, month 7.
    • AUGUST

      public static final Month AUGUST
      August, month 8.
    • SEPTEMBER

      public static final Month SEPTEMBER
      September, month 9.
    • OCTOBER

      public static final Month OCTOBER
      October, month 10.
    • NOVEMBER

      public static final Month NOVEMBER
      November, month 11.
    • DECEMBER

      public static final Month DECEMBER
      December, month 12.
  • Method Details

    • values

      public static Month[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Month valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static Month of(int month)
      The month numbered month, 1 for January to 12 for December.
    • getValue

      public int getValue()
      1 for January to 12 for December.
    • plus

      public Month plus(long months)
      The month months later, around the year.
    • minus

      public Month minus(long months)
      The month months earlier, around the year.
    • length

      public int length(boolean leapYear)
      The number of days of this month in a leap year or another.
    • minLength

      public int minLength()
      The fewest days this month can have.
    • maxLength

      public int maxLength()
      The most days this month can have.
    • firstDayOfYear

      public int firstDayOfYear(boolean leapYear)
      The day of the year this month starts on, 1 for January.
    • firstMonthOfQuarter

      public Month firstMonthOfQuarter()
      The first month of the quarter this month is in.