Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to turna date into a LocalDateTime java

public LocalDateTime convertToLocalDateTimeViaMilisecond(Date dateToConvert) {
    return Instant.ofEpochMilli(dateToConvert.getTime())
      .atZone(ZoneId.systemDefault())
      .toLocalDateTime();
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #turna #date #LocalDateTime #java
ADD COMMENT
Topic
Name
5+8 =