本文整理汇总了Java中java.time.OffsetDateTime.MIN属性的典型用法代码示例。如果您正苦于以下问题:Java OffsetDateTime.MIN属性的具体用法?Java OffsetDateTime.MIN怎么用?Java OffsetDateTime.MIN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.time.OffsetDateTime
的用法示例。
在下文中一共展示了OffsetDateTime.MIN属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: data_adjustInto
@DataProvider(name="adjustInto")
Object[][] data_adjustInto() {
return new Object[][]{
{OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), OffsetDateTime.of(2012, 3, 4, 1, 1, 1, 100, ZoneOffset.UTC), OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), null},
{OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), OffsetDateTime.MAX, OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), null},
{OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), OffsetDateTime.MIN, OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), null},
{OffsetDateTime.MAX, OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), OffsetDateTime.of(OffsetDateTime.MAX.toLocalDateTime(), ZoneOffset.ofHours(-18)), null},
{OffsetDateTime.MIN, OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), OffsetDateTime.of(OffsetDateTime.MIN.toLocalDateTime(), ZoneOffset.ofHours(18)), null},
{OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE),
ZonedDateTime.of(2012, 3, 4, 1, 1, 1, 100, ZONE_GAZA), ZonedDateTime.of(2012, 3, 4, 23, 5, 0, 0, ZONE_GAZA), null},
{OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), LocalDateTime.of(2012, 3, 4, 1, 1, 1, 100), null, DateTimeException.class},
{OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), LocalDate.of(2210, 2, 2), null, DateTimeException.class},
{OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), LocalTime.of(22, 3, 0), null, DateTimeException.class},
{OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), OffsetTime.of(22, 3, 0, 0, ZoneOffset.UTC), null, DateTimeException.class},
{OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), null, null, NullPointerException.class},
};
}
示例2: deNormalizeDateTimeOffset
private OffsetDateTime deNormalizeDateTimeOffset(byte[] value) {
// we stored the date and offset as 2 normalized Int64s. So split our input
// byte array and de-normalize the pieces
byte[] denormalizedDtValue = new byte[(Long.SIZE / Byte.SIZE)];
byte[] denormalizedOffsetTicks = new byte[(Long.SIZE / Byte.SIZE)];
System.arraycopy(value, 0, denormalizedDtValue, 0, denormalizedDtValue.length);
System.arraycopy(value, denormalizedDtValue.length, denormalizedOffsetTicks, 0, denormalizedOffsetTicks.length);
long datePart = deNormalizeInt64(denormalizedDtValue);
long offsetPart = deNormalizeInt64(denormalizedOffsetTicks);
if (datePart == Long.MIN_VALUE) {
return OffsetDateTime.MIN;
}
ZoneOffset zoneOffset = ZoneId.systemDefault().getRules().getOffset(LocalDateTime.now());
LocalDateTime date = LocalDateTime.ofEpochSecond(datePart, 0, zoneOffset).plusSeconds(offsetPart);
return OffsetDateTime.of(date, zoneOffset);
}
示例3: samples
@Override
protected List<TemporalAccessor> samples() {
TemporalAccessor[] array = {TEST_2008_6_30_11_30_59_000000500, OffsetDateTime.MIN, OffsetDateTime.MAX};
return Arrays.asList(array);
}