The toLocalDate() method of LocalDateTime class is used to get the LocalDate representation of this LocalDateTime. This method is derived from the Object Class and behaves in the similar way.
public LocalDate toLocalDate()
Parameter: This method takes no parameters.
Returns: This method returns a LocalDate value which is the LocalDate representation of this LocalDateTime.
Below programs illustrate the LocalDateTime.toLocalDate() method:
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.