datetime - Convert java.util.Date to java.time.LocalDate - Stack Overflow
Date input = new Date(); LocalDate date = input.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
Explanation:
Despite its name, java.util.Date
represents an instant on the time-line, not a "date". The actual data stored within the object is a long
count of milliseconds since 1970-01-01T00:00Z (midnight at the start of 1970 GMT/UTC)
Read full article from datetime - Convert java.util.Date to java.time.LocalDate - Stack Overflow
No comments:
Post a Comment