ChronoLocalDateTime toLocalDate() method in Java with Examples
The toLocalDate() method of a ChronoLocalDateTime interface is used to convert this ChronoLocalDateTime to an LocalDate. The method returns the LocalDate part of this ChronoLocalDateTime.
default LocalDate toLocalDate()
Parameters: This method do not accept any parameter.
Return value: This method returns LocalDate which is the LocalDate of this ChronoLocalDateTime
Below programs illustrate the toLocalDate() method:
ChronoLocalDateTime: 2019-12-31T19:15:30 LocalDate: 2019-12-31
ChronoLocalDateTime: 2018-10-25T23:12:31.123 LocalDate: 2018-10-25
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. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.