Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to turna date into a LocalDateTime java

public LocalDateTime convertToLocalDateTimeViaInstant(Date dateToConvert) {
    return dateToConvert.toInstant()
      .atZone(ZoneId.systemDefault())
      .toLocalDateTime();
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #turna #date #LocalDateTime #java
ADD COMMENT
Topic
Name
7+2 =