Answers for "convert localdatetime to localdate"

1

date to localdate

dateToConvert.toInstant()
      .atZone(ZoneId.systemDefault())
      .toLocalDate();
Posted by: Guest on August-10-2020
-1

convert localdatetime to localdate

import java.time.LocalDate;
import java.time.LocalDateTime;
 
public class Main {
    public static void main(String[] args) {
 
        LocalDateTime localDateTime = LocalDateTime.now();
         
        LocalDate localDate = localDateTime.toLocalDate();
         
        System.out.println(localDate);
    }
}
Posted by: Guest on May-12-2020

Code answers related to "convert localdatetime to localdate"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language