Java Date Time - LocalDate getEra() example








LocalDate getEra() gets the era applicable at this date.

Syntax

getEra has the following syntax.

public Era getEra()

Example

The following example shows how to use getEra.

import java.time.LocalDate;

public class Main {
  public static void main(String[] args) {
    LocalDate a = LocalDate.of(2014, 6, 30);

    System.out.println(a.getEra().getValue());
  }
}

The code above generates the following result.