Answers for "how to convert date into localdatetime in java"

1

localdate to date java

// Localdate to Date
Date.from(localdate.atStartOfDay(ZoneId.systemDefault()).toInstant())
Posted by: Guest on February-10-2021
-2

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 "how to convert date into localdatetime in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language