Java Date Time - Month AUGUST example








Month AUGUST defines the singleton instance for the month of August with 31 days.

This has the numeric value of 8.

Syntax

AUGUST has the following syntax.

public static final Month AUGUST

Example

The following example shows how to use AUGUST.

import java.time.Month;
/*  ww  w  .j  a  v  a 2  s  .  c  o  m*/
public class Main {
  public static void main(String[] args) {
    Month m = Month.AUGUST;
    System.out.println(m.getValue());
    System.out.println(m.name());
    System.out.println(m.ordinal());
  }
}

The code above generates the following result.