本文整理匯總了Java中java.time.LocalTime.NOON屬性的典型用法代碼示例。如果您正苦於以下問題:Java LocalTime.NOON屬性的具體用法?Java LocalTime.NOON怎麽用?Java LocalTime.NOON使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.time.LocalTime
的用法示例。
在下文中一共展示了LocalTime.NOON屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getZonedDateTimeAt
@Override
public final ZonedDateTime getZonedDateTimeAt(double x, double y) {
int day = (int) (x / (getWidth() / getNumberOfDays()));
LocalDate date = getDate();
if (isAdjustToFirstDayOfWeek()) {
date = Util.adjustToFirstDayOfWeek(date, getFirstDayOfWeek());
}
date = date.plusDays(day);
LocalTime time = LocalTime.NOON;
ZoneId zoneId = getZoneId();
return ZonedDateTime.of(date, time, zoneId);
}
示例2: data_adjustInto
@DataProvider(name="adjustInto")
Object[][] data_adjustInto() {
return new Object[][]{
{LocalTime.of(23, 5), LocalTime.of(4, 1, 1, 100), LocalTime.of(23, 5, 0, 0), null},
{LocalTime.of(23, 5, 20), LocalTime.of(4, 1, 1, 100), LocalTime.of(23, 5, 20, 0), null},
{LocalTime.of(23, 5, 20, 1000), LocalTime.of(4, 1, 1, 100), LocalTime.of(23, 5, 20, 1000), null},
{LocalTime.of(23, 5, 20, 1000), LocalTime.MAX, LocalTime.of(23, 5, 20, 1000), null},
{LocalTime.of(23, 5, 20, 1000), LocalTime.MIN, LocalTime.of(23, 5, 20, 1000), null},
{LocalTime.of(23, 5, 20, 1000), LocalTime.NOON, LocalTime.of(23, 5, 20, 1000), null},
{LocalTime.of(23, 5, 20, 1000), LocalTime.MIDNIGHT, LocalTime.of(23, 5, 20, 1000), null},
{LocalTime.MAX, LocalTime.of(23, 5, 20, 1000), LocalTime.of(23, 59, 59, 999999999), null},
{LocalTime.MIN, LocalTime.of(23, 5, 20, 1000), LocalTime.of(0, 0, 0), null},
{LocalTime.NOON, LocalTime.of(23, 5, 20, 1000), LocalTime.of(12, 0, 0), null},
{LocalTime.MIDNIGHT, LocalTime.of(23, 5, 20, 1000), LocalTime.of(0, 0, 0), null},
{LocalTime.of(23, 5), LocalDateTime.of(2210, 2, 2, 1, 1), LocalDateTime.of(2210, 2, 2, 23, 5), null},
{LocalTime.of(23, 5), OffsetTime.of(1, 1, 0, 0, OFFSET_PTWO), OffsetTime.of(23, 5, 0, 0, OFFSET_PTWO), null},
{LocalTime.of(23, 5), OffsetDateTime.of(2210, 2, 2, 1, 1, 0, 0, OFFSET_PTWO), OffsetDateTime.of(2210, 2, 2, 23, 5, 0, 0, OFFSET_PTWO), null},
{LocalTime.of(23, 5), ZonedDateTime.of(2210, 2, 2, 1, 1, 0, 0, ZONE_PARIS), ZonedDateTime.of(2210, 2, 2, 23, 5, 0, 0, ZONE_PARIS), null},
{LocalTime.of(23, 5), LocalDate.of(2210, 2, 2), null, DateTimeException.class},
{LocalTime.of(23, 5), null, null, NullPointerException.class},
};
}
示例3: samples
@Override
protected List<TemporalAccessor> samples() {
TemporalAccessor[] array = {TEST_12_30_40_987654321, LocalTime.MIN, LocalTime.MAX, LocalTime.MIDNIGHT, LocalTime.NOON};
return Arrays.asList(array);
}
示例4: getNoonTime
public LocalTime getNoonTime() {
return LocalTime.NOON;
}