BAEL-1344 add java9 example
This commit is contained in:
@@ -27,8 +27,9 @@ public class DateToLocalDateConverter {
|
||||
}
|
||||
|
||||
public static LocalDate convertToLocalDateViaMilisecond(Date dateToConvert) {
|
||||
return LocalDate.from(Instant.ofEpochMilli(dateToConvert.getTime())
|
||||
.atZone(ZoneId.systemDefault()));
|
||||
return Instant.ofEpochMilli(dateToConvert.getTime())
|
||||
.atZone(ZoneId.systemDefault())
|
||||
.toLocalDate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,8 +27,9 @@ public class DateToLocalDateTimeConverter {
|
||||
}
|
||||
|
||||
public static LocalDateTime convertToLocalDateTimeViaMilisecond(Date dateToConvert) {
|
||||
return LocalDateTime.from(Instant.ofEpochMilli(dateToConvert.getTime())
|
||||
.atZone(ZoneId.systemDefault()));
|
||||
return Instant.ofEpochMilli(dateToConvert.getTime())
|
||||
.atZone(ZoneId.systemDefault())
|
||||
.toLocalDateTime();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user