Skip to content
Related Articles

Related Articles

ChronoLocalDateTime getChronology() method in Java with Examples
  • Last Updated : 29 May, 2019

The getChronology() method of ChronoLocalDateTime interface in Java gets the chronology of this date of the calendar system in use.

Syntax:

default Chronology getChronology()

Parameter: This method does not accept any parameter.

Return Value: It returns the chronology and not null.

Below programs illustrate the getChronology() method of ChronoLocalDateTime in Java:



Program 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

// Program to illustrate the getChronology() method
  
import java.util.*;
import java.time.*;
import java.time.chrono.*;
import java.time.temporal.ChronoField;
  
public class GfG {
    public static void main(String[] args)
    {
        ChronoLocalDateTime date
            = LocalDateTime
                  .from(ZonedDateTime.now());
  
        System.out.println(date.getChronology());
    }
}

chevron_right


Output:

ISO

Reference: https://docs.oracle.com/javase/9/docs/api/java/time/chrono/ChronoLocalDateTime.html#getChronology–

Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :