ZonedDateTime toLocalDate() method in Java with Examples Last Updated : 07 Dec, 2018 Comments Improve Suggest changes Like Article Like Report The toLocalDate() method of a ZonedDateTime class is used to return the LocalDate part of this date-time object with the same year, month and day as this date-time. Syntax: public LocalDate toLocalDate() Parameters: This method does not take any parameters. Return value: This method returns a LocalDate representing the date part of this date-time, not null. Below programs illustrate the toLocalDate() method: Program 1: Java // Java program to demonstrate // ZonedDateTime.toLocalDate() method import java.time.*; public class GFG { public static void main(String[] args) { // create a ZonedDateTime object ZonedDateTime zoneddatetime = ZonedDateTime.parse( "2018-12-06T19:21:12.123+05:30[Asia/Calcutta]"); // print result System.out.println("ZonedDateTime: " + zoneddatetime); // get LocalDate LocalDate value = zoneddatetime.toLocalDate(); // print result System.out.println("LocalDate: " + value); } } Output: ZonedDateTime: 2018-12-06T19:21:12.123+05:30[Asia/Calcutta] LocalDate: 2018-12-06 Program 2: Java // Java program to demonstrate // ZonedDateTime.toLocalDate() method import java.time.*; public class GFG { public static void main(String[] args) { // create a ZonedDateTime object ZonedDateTime zoneddatetime = ZonedDateTime.parse( "2018-10-25T23:12:31.123+02:00[Europe/Paris]"); // print result System.out.println("ZonedDateTime: " + zoneddatetime); // get LocalDate LocalDate value = zoneddatetime.toLocalDate(); // print result System.out.println("LocalDate: " + value); } } Output: ZonedDateTime: 2018-10-25T23:12:31.123+02:00[Europe/Paris] LocalDate: 2018-10-25 Reference: https://docs.oracle.com/javase/10/docs/api/java/time/ZonedDateTime.html#toLocalDate() Comment More infoAdvertise with us Next Article ZonedDateTime toLocalDate() method in Java with Examples A AmanSingh2210 Follow Improve Article Tags : Java Java-Functions Java-time package Java-ZonedDateTime Practice Tags : Java Similar Reads ZonedDateTime toLocalDateTime() method in Java with Examples The toLocalDateTime() method of a ZonedDateTime class is used to return the LocalDateTime part of this date-time object with the same year, month, day and time as this date-time. Syntax: public LocalDateTime toLocalDateTime() Parameters: This method does not take any parameters. Return value: This m 1 min read ZonedDateTime toLocalTime() method in Java with Examples The toLocalTime() method of a ZonedDateTime class is used to return the LocalTime part of this date-time object with the same hour, minute, second and nanosecond as this date-time. Syntax: public LocalTime toLocalTime() Parameters: This method does not take any parameters. Return value: This method 1 min read ZonedDateTime ofLocal() method in Java with Examples ofLocal() method of an ZonedDateTime class used to create an instance of ZonedDateTime from the Local date-time using ZoneId and the preferred offset if possible where all three localDateTime, ZoneOffset and ZoneId are passed as parameter.The local date-time is resolved to a single instant on the ti 2 min read ZonedDateTime of() Method in Java with Examples In ZonedDateTime class, there are three types of() method depending upon the parameters passed to it. of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneId zone) of() method of a ZonedDateTime class used to get an instance of ZonedDateTime from a year, mo 3 min read ZonedDateTime toString() method in Java with Examples The toString() method of a ZonedDateTime class is used to return this ZonedDateTime as a String. The string consists of the LocalDateTime followed by the ZoneOffset. If the ZoneId is not the same as the offset, then the ID is output. Syntax: public String toString() Parameters: This method does not 1 min read Like