Answers for "java Date to LocalDataTime"

1

localdate to timestamp in java

Timestamp timestamp = Timestamp.valueOf(localDate.atStartOfDay());
Posted by: Guest on December-14-2020
0

how to turna date into a LocalDateTime java

public LocalDateTime convertToLocalDateTimeViaInstant(Date dateToConvert) {
    return dateToConvert.toInstant()
      .atZone(ZoneId.systemDefault())
      .toLocalDateTime();
}
Posted by: Guest on February-10-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language