ChronoZonedDateTime getZone() method in Java with Examples Last Updated : 30 May, 2019 Comments Improve Suggest changes Like Article Like Report The getZone() method of a ChronoZonedDateTime interface is used to get the time-zone from this ChronoZonedDateTime. This method returns the ZoneId such as 'Asia/Calcutta'. Syntax: default ZoneId getZone() Parameters: This method does not take any parameters. Return value: This method returns a ZoneId representing the time-zone. Below programs illustrate the getZone() method: Program 1: Java // Java program to demonstrate // ChronoZonedDateTime.getZone() method import java.time.*; import java.time.chrono.*; public class GFG { public static void main(String[] args) { // create a ChronoZonedDateTime object ChronoZonedDateTime zoneddatetime = ZonedDateTime.parse( "2018-12-06T19:21:12.123+05:30[Asia/Calcutta]"); // get zone ZoneId value = zoneddatetime.getZone(); // print result System.out.println("Time Zone:" + value); } } Output: Time Zone:Asia/Calcutta Program 2: Java // Java program to demonstrate // ChronoZonedDateTime.getZone() method import java.time.*; import java.time.chrono.*; public class GFG { public static void main(String[] args) { // create a ChronoZonedDateTime object ChronoZonedDateTime zoneddatetime = ZonedDateTime.parse( "1918-10-25T23:12:38.543+02:00[Europe/Paris]"); // get zone ZoneId value = zoneddatetime.getZone(); // print result System.out.println("Time Zone:" + value); } } Output: Time Zone:Europe/Paris Reference: https://docs.oracle.com/javase/9/docs/api/java/time/chrono/ChronoZonedDateTime.html#getZone-- Comment More infoAdvertise with us Next Article ChronoZonedDateTime getZone() method in Java with Examples S ShubhamMaurya3 Follow Improve Article Tags : Misc Java Java-Functions Java-ChronoZonedDateTime Java-Time-Chrono package +1 More Practice Tags : JavaMisc Similar Reads ChronoZonedDateTime get() method in Java with Examples The get() method of ChronoZonedDateTime interface in Java is used to get the value of the specified field passed as input from this ChronoZonedDateTime as an integer.This method queries this ChronoZonedDateTime for the value of the field and the returned value will always be within the valid range o 2 min read ChronoZonedDateTime getOffset() method in Java with Examples The getOffset() method of ChronoZonedDateTime interface in Java gets the zone offset of this date. Syntax: default ZoneOffset getOffset() Parameter: This method does not accept any parameter. Return Value: It returns the zone offset and not null. Below programs illustrate the get() method: Program 1 1 min read ChronoZonedDateTime from() method in Java with Examples The from() method of ChronoZonedDateTime interface in Java method obtains an instance of ChronoZonedDateTime from a temporal object. Syntax: static ChronoZonedDateTime from(TemporalAccessor temporal) Parameter: This method accepts a parameter temporal which specifies the temporal object to convert a 1 min read ChronoZonedDateTime format() method in Java with Examples The format() method of ChronoZonedDateTime interface in Java is used to format this date-time using the specified formatter passed as parameter.This date-time will be passed to the formatter to produce a string. Syntax: default String format(DateTimeFormatter formatter) Parameters: This method accep 2 min read ChronoLocalDateTime getChronology() method in Java with Examples 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 il 1 min read Like