from(Instant instant)和toInstant()方法
// Obtains an instance of Date from an Instant object.
public static Date from(Instant instant) {
try {
return new Date(instant.toEpochMilli());
} catch (ArithmeticException ex) {
throw new IllegalArgumentException(ex);
}
}
// Converts this Date object to an Instant.
public Instant toInstant() {
return Instant.ofEpochMilli(getTime());
}