1.Date ts = ...;
Instant instant = Instant.ofEpochMilli(ts.getTime());
LocalDateTime res = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
The big trick (for all these conversions) is to convert to Instant. This can be converted to LocalDateTime by telling the system
which timezone to use. This needs to be the system default locale, otherwise the time will change.
2.Date date = ...;
Instant instant = Instant.ofEpochMilli(date.getTime());
LocalDate res = LocalDateTime.ofInstant(instant, ZoneId.systemDefault()).toLocalDate();