Period getChronology() example

Description

Period getChronology() gets the chronology of this period, which is the ISO calendar system.

Syntax

getChronology has the following syntax.


public IsoChronology getChronology()

Example

The following example shows how to use getChronology.


import java.time.Period;
//from  ww  w.  ja v  a  2s .  c  o  m
public class Main {
  public static void main(String[] args) {
    Period p = Period.ofMonths(1);
    
    System.out.println(p.getChronology());

  }
}

The code above generates the following result.





















Home »
  Java Date Time »
    java.time Reference »




Clock
DayOfWeek
Duration
Instant
LocalDate
LocalDateTime
LocalTime
Month
MonthDay
OffsetDateTime
OffsetTime
Period
Year
YearMonth
ZonedDateTime
ZoneId
ZoneOffset