下面列出了java.time.OffsetTime#atDate ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
public Timestamp toNonNullValue(OffsetTime value) {
OffsetDateTime odt = value.atDate(LocalDate.of(1970, 1, 1));
final Timestamp timestamp = new Timestamp((odt.toEpochSecond() * MILLIS_IN_SECOND));
timestamp.setNanos(value.getNano());
return timestamp;
}
/**
* Returns a {@link java.time.OffsetDateTime} from this date and the provided {@link java.time.OffsetTime}.
*
* @param self a LocalDate
* @param time an OffsetTime
* @return an OffsetDateTime
* @since 2.5.0
*/
public static OffsetDateTime leftShift(final LocalDate self, OffsetTime time) {
return time.atDate(self);
}