Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

java
communitycreator
getchronology
period

What is Period.getChronology() in Java?

abhilash

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

getChronology() is an instance method of the Period which is used to retrieve the chronology of the Period object, i.e ISOInternational Organization for Standardization calendar system.

The Chronology represents the calendar system in use.

getChronology() method is defined in the Period class. The Period class is defined in the java.time package. To import the Period class, use the following import statement:

import java.time.Period;

Syntax


public IsoChronology getChronology()

Parameters

This method takes no parameters.

Return value

This method returns the ISO chronology.

Code

import java.time.Period;
public class Main{
public static void main(String[] args) {
int numMonths = 0;
int numYears = 0;
int numDays = 0;
Period period = Period.of(numYears, numMonths, numDays);
System.out.printf("Chronology(%s) = %s\n", period, period.getChronology());
}
}

RELATED TAGS

java
communitycreator
getchronology
period

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring