Java Code Examples for java.time.OffsetTime#atDate()

The following examples show how to use java.time.OffsetTime#atDate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TimestampColumnOffsetTimeMapper.java    From jadira with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example 2
Source File: DateTimeExtensions.java    From groovy with Apache License 2.0 2 votes vote down vote up
/**
 * 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);
}