/** * Returns a copy of this time with the specified field set to a new value. * <p> * This returns a {@code LocalTime}, based on this one, with the value * for the specified field changed. * This can be used to change any supported field, such as the hour, minute or second. * If it is not possible to set the value, because the field is not supported or for * some other reason, an exception is thrown. * <p> * If the field is a {@link ChronoField} then the adjustment is implemented here. * The supported fields behave as follows: * <ul> * <li>{@code NANO_OF_SECOND} - * Returns a {@code LocalTime} with the specified nano-of-second. * The hour, minute and second will be unchanged. * <li>{@code NANO_OF_DAY} - * Returns a {@code LocalTime} with the specified nano-of-day. * This completely replaces the time and is equivalent to {@link #ofNanoOfDay(long)}. * <li>{@code MICRO_OF_SECOND} - * Returns a {@code LocalTime} with the nano-of-second replaced by the specified * micro-of-second multiplied by 1,000. * The hour, minute and second will be unchanged. * <li>{@code MICRO_OF_DAY} - * Returns a {@code LocalTime} with the specified micro-of-day. * This completely replaces the time and is equivalent to using {@link #ofNanoOfDay(long)} * with the micro-of-day multiplied by 1,000. * <li>{@code MILLI_OF_SECOND} - * Returns a {@code LocalTime} with the nano-of-second replaced by the specified * milli-of-second multiplied by 1,000,000. * The hour, minute and second will be unchanged. * <li>{@code MILLI_OF_DAY} - * Returns a {@code LocalTime} with the specified milli-of-day. * This completely replaces the time and is equivalent to using {@link #ofNanoOfDay(long)} * with the milli-of-day multiplied by 1,000,000. * <li>{@code SECOND_OF_MINUTE} - * Returns a {@code LocalTime} with the specified second-of-minute. * The hour, minute and nano-of-second will be unchanged. * <li>{@code SECOND_OF_DAY} - * Returns a {@code LocalTime} with the specified second-of-day. * The nano-of-second will be unchanged. * <li>{@code MINUTE_OF_HOUR} - * Returns a {@code LocalTime} with the specified minute-of-hour. * The hour, second-of-minute and nano-of-second will be unchanged. * <li>{@code MINUTE_OF_DAY} - * Returns a {@code LocalTime} with the specified minute-of-day. * The second-of-minute and nano-of-second will be unchanged. * <li>{@code HOUR_OF_AMPM} - * Returns a {@code LocalTime} with the specified hour-of-am-pm. * The AM/PM, minute-of-hour, second-of-minute and nano-of-second will be unchanged. * <li>{@code CLOCK_HOUR_OF_AMPM} - * Returns a {@code LocalTime} with the specified clock-hour-of-am-pm. * The AM/PM, minute-of-hour, second-of-minute and nano-of-second will be unchanged. * <li>{@code HOUR_OF_DAY} - * Returns a {@code LocalTime} with the specified hour-of-day. * The minute-of-hour, second-of-minute and nano-of-second will be unchanged. * <li>{@code CLOCK_HOUR_OF_DAY} - * Returns a {@code LocalTime} with the specified clock-hour-of-day. * The minute-of-hour, second-of-minute and nano-of-second will be unchanged. * <li>{@code AMPM_OF_DAY} - * Returns a {@code LocalTime} with the specified AM/PM. * The hour-of-am-pm, minute-of-hour, second-of-minute and nano-of-second will be unchanged. * </ul> * <p> * In all cases, if the new value is outside the valid range of values for the field * then a {@code DateTimeException} will be thrown. * <p> * All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}. * <p> * If the field is not a {@code ChronoField}, then the result of this method * is obtained by invoking {@code TemporalField.adjustInto(Temporal, long)} * passing {@code this} as the argument. In this case, the field determines * whether and how to adjust the instant. * <p> * This instance is immutable and unaffected by this method call. * * @param TemporalField $field the field to set in the result, not null * @param int $newValue the new value of the field in the result * @return LocalTime a {@code LocalTime} based on {@code this} with the specified field set, not null * @throws DateTimeException if the field cannot be set * @throws UnsupportedTemporalTypeException if the field is not supported * @throws ArithmeticException if numeric overflow occurs */ public function with(TemporalField $field, $newValue) { if ($field instanceof ChronoField) { $f = $field; $f->checkValidValue($newValue); switch ($f) { case ChronoField::NANO_OF_SECOND(): return $this->withNano((int) $newValue); case ChronoField::NANO_OF_DAY(): return self::ofNanoOfDay($newValue); case ChronoField::MICRO_OF_SECOND(): return $this->withNano((int) $newValue * 1000); case ChronoField::MICRO_OF_DAY(): return self::ofNanoOfDay($newValue * 1000); case ChronoField::MILLI_OF_SECOND(): return $this->withNano((int) $newValue * 1000000); case ChronoField::MILLI_OF_DAY(): return self::ofNanoOfDay($newValue * 1000000); case ChronoField::SECOND_OF_MINUTE(): return $this->withSecond((int) $newValue); case ChronoField::SECOND_OF_DAY(): return $this->plusSeconds($newValue - $this->toSecondOfDay()); case ChronoField::MINUTE_OF_HOUR(): return $this->withMinute((int) $newValue); case ChronoField::MINUTE_OF_DAY(): return $this->plusMinutes($newValue - ($this->hour * 60 + $this->minute)); case ChronoField::HOUR_OF_AMPM(): return $this->plusHours($newValue - $this->hour % 12); case ChronoField::CLOCK_HOUR_OF_AMPM(): return $this->plusHours(($newValue === 12 ? 0 : $newValue) - $this->hour % 12); case ChronoField::HOUR_OF_DAY(): return $this->withHour((int) $newValue); case ChronoField::CLOCK_HOUR_OF_DAY(): return $this->withHour((int) ($newValue === 24 ? 0 : $newValue)); case ChronoField::AMPM_OF_DAY(): return $this->plusHours(($newValue - Math::div($this->hour, 12)) * 12); } throw new UnsupportedTemporalTypeException("Unsupported field: " . $field); } return $field->adjustInto($this, $newValue); }
/** * Returns a copy of this instant with the specified field set to a new value. * <p> * This returns an Instant {@code Instant}, based on this one, with the value * for the specified field changed. * If it is not possible to set the value, because the field is not supported or for * some other reason, an exception is thrown. * <p> * If the field is a {@link ChronoField} then the adjustment is implemented here. * The supported fields behave as follows: * <ul> * <li>{@code NANO_OF_SECOND} - * Returns an Instant {@code Instant} with the specified nano-of-second. * The epoch-second will be unchanged. * <li>{@code MICRO_OF_SECOND} - * Returns an Instant {@code Instant} with the nano-of-second replaced by the specified * micro-of-second multiplied by 1,000. The epoch-second will be unchanged. * <li>{@code MILLI_OF_SECOND} - * Returns an Instant {@code Instant} with the nano-of-second replaced by the specified * milli-of-second multiplied by 1,000,000. The epoch-second will be unchanged. * <li>{@code INSTANT_SECONDS} - * Returns an Instant {@code Instant} with the specified epoch-second. * The nano-of-second will be unchanged. * </ul> * <p> * In all cases, if the new value is outside the valid range of values for the field * then a {@code DateTimeException} will be thrown. * <p> * All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}. * <p> * If the field is not a {@code ChronoField}, then the result of this method * is obtained by invoking {@code TemporalField.adjustInto(Temporal, long)} * passing {@code this} as the argument. In this case, the field determines * whether and how to adjust the instant. * <p> * This instance is immutable and unaffected by this method call. * * @param TemporalField $field the field to set in the result, not null * @param int $newValue the new value of the field in the result * @return Instant an Instant {@code Instant} based on {@code this} with the specified field set, not null * @throws DateTimeException if the field cannot be set * @throws UnsupportedTemporalTypeException if the field is not supported * @throws ArithmeticException if numeric overflow occurs */ public function with(TemporalField $field, $newValue) { if ($field instanceof ChronoField) { $f = $field; $f->checkValidValue($newValue); switch ($f) { case ChronoField::MILLI_OF_SECOND(): $nval = (int) $newValue * 1000000; return $nval != $this->nanos ? self::create($this->seconds, $nval) : $this; case ChronoField::MICRO_OF_SECOND(): $nval = (int) $newValue * 1000; return $nval != $this->nanos ? self::create($this->seconds, $nval) : $this; case ChronoField::NANO_OF_SECOND(): return $newValue != $this->nanos ? self::create($this->seconds, (int) $newValue) : $this; case ChronoField::INSTANT_SECONDS(): return $newValue != $this->seconds ? self::create($newValue, $this->nanos) : $this; } throw new UnsupportedTemporalTypeException("Unsupported field: " . $field); } return $field->adjustInto($this, $newValue); }
public function test_isSupported_TemporalField() { // TODO $this->assertEquals($this->TEST_DATE_TIME->isSupported(null), false); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::NANO_OF_SECOND()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::NANO_OF_DAY()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::MICRO_OF_SECOND()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::MICRO_OF_DAY()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::MILLI_OF_SECOND()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::MILLI_OF_DAY()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::SECOND_OF_MINUTE()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::SECOND_OF_DAY()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::MINUTE_OF_HOUR()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::MINUTE_OF_DAY()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::HOUR_OF_AMPM()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::CLOCK_HOUR_OF_AMPM()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::HOUR_OF_DAY()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::CLOCK_HOUR_OF_DAY()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::AMPM_OF_DAY()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::DAY_OF_WEEK()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::ALIGNED_DAY_OF_WEEK_IN_MONTH()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::ALIGNED_DAY_OF_WEEK_IN_YEAR()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::DAY_OF_MONTH()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::DAY_OF_YEAR()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::EPOCH_DAY()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::ALIGNED_WEEK_OF_MONTH()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::ALIGNED_WEEK_OF_YEAR()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::MONTH_OF_YEAR()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::PROLEPTIC_MONTH()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::YEAR()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::YEAR_OF_ERA()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::ERA()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::INSTANT_SECONDS()), true); $this->assertEquals($this->TEST_DATE_TIME->isSupported(CF::OFFSET_SECONDS()), true); }
function data_fieldBased() { return [[CF::DAY_OF_WEEK(), true, false], [CF::ALIGNED_DAY_OF_WEEK_IN_MONTH(), true, false], [CF::ALIGNED_DAY_OF_WEEK_IN_YEAR(), true, false], [CF::DAY_OF_MONTH(), true, false], [CF::DAY_OF_YEAR(), true, false], [CF::EPOCH_DAY(), true, false], [CF::ALIGNED_WEEK_OF_MONTH(), true, false], [CF::ALIGNED_WEEK_OF_YEAR(), true, false], [CF::MONTH_OF_YEAR(), true, false], [CF::PROLEPTIC_MONTH(), true, false], [CF::YEAR_OF_ERA(), true, false], [CF::YEAR(), true, false], [CF::ERA(), true, false], [CF::AMPM_OF_DAY(), false, true], [CF::CLOCK_HOUR_OF_DAY(), false, true], [CF::HOUR_OF_DAY(), false, true], [CF::CLOCK_HOUR_OF_AMPM(), false, true], [CF::HOUR_OF_AMPM(), false, true], [CF::MINUTE_OF_DAY(), false, true], [CF::MINUTE_OF_HOUR(), false, true], [CF::SECOND_OF_DAY(), false, true], [CF::SECOND_OF_MINUTE(), false, true], [CF::MILLI_OF_DAY(), false, true], [CF::MILLI_OF_SECOND(), false, true], [CF::MICRO_OF_DAY(), false, true], [CF::MICRO_OF_SECOND(), false, true], [CF::NANO_OF_DAY(), false, true], [CF::NANO_OF_SECOND(), false, true]]; }
/** * @dataProvider data_instantNoZone */ public function test_parse_instantNoZone_supported(DateTimeFormatter $formatter, $text, Instant $expected) { $actual = $formatter->parse($text); $this->assertEquals($actual->isSupported(CF::INSTANT_SECONDS()), true); $this->assertEquals($actual->isSupported(CF::EPOCH_DAY()), false); $this->assertEquals($actual->isSupported(CF::SECOND_OF_DAY()), false); $this->assertEquals($actual->isSupported(CF::NANO_OF_SECOND()), true); $this->assertEquals($actual->isSupported(CF::MICRO_OF_SECOND()), true); $this->assertEquals($actual->isSupported(CF::MILLI_OF_SECOND()), true); }
private function resolveFractional() { // ensure fractional seconds available as CF requires // resolveTimeLenient() will have merged CF::MICRO_OF_SECOND()/MILLI_OF_SECOND to NANO_OF_SECOND if ($this->time == null && ($this->fieldValues->has(CF::INSTANT_SECONDS()) || $this->fieldValues->has(CF::SECOND_OF_DAY()) || $this->fieldValues->has(CF::SECOND_OF_MINUTE()))) { if ($this->fieldValues->has(CF::NANO_OF_SECOND())) { $nos = $this->fieldValues->get(CF::NANO_OF_SECOND()); $this->fieldValues->put(CF::MICRO_OF_SECOND(), Math::div($nos, 1000)); $this->fieldValues->put(CF::MILLI_OF_SECOND(), Math::div($nos, 1000000)); } else { $this->fieldValues->put(CF::NANO_OF_SECOND(), 0); $this->fieldValues->put(CF::MICRO_OF_SECOND(), 0); $this->fieldValues->put(CF::MILLI_OF_SECOND(), 0); } } }
public function test_parse_fromField_SecondOfMinute_NanoOfSecond() { $fmt = (new DateTimeFormatterBuilder())->appendValue(ChronoField::SECOND_OF_MINUTE())->appendLiteral('.')->appendValue(ChronoField::NANO_OF_SECOND())->toFormatter(); $acc = $fmt->parse("32.123456789"); $this->assertEquals($acc->isSupported(ChronoField::SECOND_OF_MINUTE()), true); $this->assertEquals($acc->isSupported(ChronoField::NANO_OF_SECOND()), true); $this->assertEquals($acc->isSupported(ChronoField::MICRO_OF_SECOND()), true); $this->assertEquals($acc->isSupported(ChronoField::MILLI_OF_SECOND()), true); $this->assertEquals($acc->getLong(ChronoField::SECOND_OF_MINUTE()), 32); $this->assertEquals($acc->getLong(ChronoField::NANO_OF_SECOND()), 123456789); $this->assertEquals($acc->getLong(ChronoField::MICRO_OF_SECOND()), 123456); $this->assertEquals($acc->getLong(ChronoField::MILLI_OF_SECOND()), 123); }
public function test_isSupported_TemporalField() { // TODO check //$this->assertEquals(TEST_2008.isSupported((TemporalField) null()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::NANO_OF_SECOND()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::NANO_OF_DAY()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::MICRO_OF_SECOND()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::MICRO_OF_DAY()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::MILLI_OF_SECOND()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::MILLI_OF_DAY()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::SECOND_OF_MINUTE()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::SECOND_OF_DAY()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::MINUTE_OF_HOUR()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::MINUTE_OF_DAY()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::HOUR_OF_AMPM()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::CLOCK_HOUR_OF_AMPM()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::HOUR_OF_DAY()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::CLOCK_HOUR_OF_DAY()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::AMPM_OF_DAY()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::DAY_OF_WEEK()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::ALIGNED_DAY_OF_WEEK_IN_MONTH()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::ALIGNED_DAY_OF_WEEK_IN_YEAR()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::DAY_OF_MONTH()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::DAY_OF_YEAR()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::EPOCH_DAY()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::ALIGNED_WEEK_OF_MONTH()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::ALIGNED_WEEK_OF_YEAR()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::MONTH_OF_YEAR()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::PROLEPTIC_MONTH()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::YEAR()), true); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::YEAR_OF_ERA()), true); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::ERA()), true); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::INSTANT_SECONDS()), false); $this->assertEquals(self::$TEST_2008->isSupported(ChronoField::OFFSET_SECONDS()), false); }
function data_withTemporalField_outOfRange() { return [[CF::NANO_OF_SECOND(), $this->time(0, 0, 0, 0), CF::NANO_OF_SECOND()->range()->getMinimum() - 1], [CF::NANO_OF_SECOND(), $this->time(0, 0, 0, 0), CF::NANO_OF_SECOND()->range()->getMaximum() + 1], [CF::NANO_OF_DAY(), $this->time(0, 0, 0, 0), CF::NANO_OF_DAY()->range()->getMinimum() - 1], [CF::NANO_OF_DAY(), $this->time(0, 0, 0, 0), CF::NANO_OF_DAY()->range()->getMaximum() + 1], [CF::MICRO_OF_SECOND(), $this->time(0, 0, 0, 0), CF::MICRO_OF_SECOND()->range()->getMinimum() - 1], [CF::MICRO_OF_SECOND(), $this->time(0, 0, 0, 0), CF::MICRO_OF_SECOND()->range()->getMaximum() + 1], [CF::MICRO_OF_DAY(), $this->time(0, 0, 0, 0), CF::MICRO_OF_DAY()->range()->getMinimum() - 1], [CF::MICRO_OF_DAY(), $this->time(0, 0, 0, 0), CF::MICRO_OF_DAY()->range()->getMaximum() + 1], [CF::MILLI_OF_SECOND(), $this->time(0, 0, 0, 0), CF::MILLI_OF_SECOND()->range()->getMinimum() - 1], [CF::MILLI_OF_SECOND(), $this->time(0, 0, 0, 0), CF::MILLI_OF_SECOND()->range()->getMaximum() + 1], [CF::MILLI_OF_DAY(), $this->time(0, 0, 0, 0), CF::MILLI_OF_DAY()->range()->getMinimum() - 1], [CF::MILLI_OF_DAY(), $this->time(0, 0, 0, 0), CF::MILLI_OF_DAY()->range()->getMaximum() + 1], [CF::SECOND_OF_MINUTE(), $this->time(0, 0, 0, 0), CF::SECOND_OF_MINUTE()->range()->getMinimum() - 1], [CF::SECOND_OF_MINUTE(), $this->time(0, 0, 0, 0), CF::SECOND_OF_MINUTE()->range()->getMaximum() + 1], [CF::SECOND_OF_DAY(), $this->time(0, 0, 0, 0), CF::SECOND_OF_DAY()->range()->getMinimum() - 1], [CF::SECOND_OF_DAY(), $this->time(0, 0, 0, 0), CF::SECOND_OF_DAY()->range()->getMaximum() + 1], [CF::MINUTE_OF_HOUR(), $this->time(0, 0, 0, 0), CF::MINUTE_OF_HOUR()->range()->getMinimum() - 1], [CF::MINUTE_OF_HOUR(), $this->time(0, 0, 0, 0), CF::MINUTE_OF_HOUR()->range()->getMaximum() + 1], [CF::MINUTE_OF_DAY(), $this->time(0, 0, 0, 0), CF::MINUTE_OF_DAY()->range()->getMinimum() - 1], [CF::MINUTE_OF_DAY(), $this->time(0, 0, 0, 0), CF::MINUTE_OF_DAY()->range()->getMaximum() + 1], [CF::HOUR_OF_AMPM(), $this->time(0, 0, 0, 0), CF::HOUR_OF_AMPM()->range()->getMinimum() - 1], [CF::HOUR_OF_AMPM(), $this->time(0, 0, 0, 0), CF::HOUR_OF_AMPM()->range()->getMaximum() + 1], [CF::CLOCK_HOUR_OF_AMPM(), $this->time(0, 0, 0, 0), CF::CLOCK_HOUR_OF_AMPM()->range()->getMinimum() - 1], [CF::CLOCK_HOUR_OF_AMPM(), $this->time(0, 0, 0, 0), CF::CLOCK_HOUR_OF_AMPM()->range()->getMaximum() + 1], [CF::HOUR_OF_DAY(), $this->time(0, 0, 0, 0), CF::HOUR_OF_DAY()->range()->getMinimum() - 1], [CF::HOUR_OF_DAY(), $this->time(0, 0, 0, 0), CF::HOUR_OF_DAY()->range()->getMaximum() + 1], [CF::CLOCK_HOUR_OF_DAY(), $this->time(0, 0, 0, 0), CF::CLOCK_HOUR_OF_DAY()->range()->getMinimum() - 1], [CF::CLOCK_HOUR_OF_DAY(), $this->time(0, 0, 0, 0), CF::CLOCK_HOUR_OF_DAY()->range()->getMaximum() + 1], [CF::AMPM_OF_DAY(), $this->time(0, 0, 0, 0), CF::AMPM_OF_DAY()->range()->getMinimum() - 1], [CF::AMPM_OF_DAY(), $this->time(0, 0, 0, 0), CF::AMPM_OF_DAY()->range()->getMaximum() + 1]]; }
function data_with_longTemporalField() { return [[Instant::ofEpochSecond(10, 200), CF::INSTANT_SECONDS(), 100, Instant::ofEpochSecond(100, 200), null], [Instant::ofEpochSecond(10, 200), CF::INSTANT_SECONDS(), 0, Instant::ofEpochSecond(0, 200), null], [Instant::ofEpochSecond(10, 200), CF::INSTANT_SECONDS(), -100, Instant::ofEpochSecond(-100, 200), null], [Instant::ofEpochSecond(10, 200), CF::NANO_OF_SECOND(), 100, Instant::ofEpochSecond(10, 100), null], [Instant::ofEpochSecond(10, 200), CF::NANO_OF_SECOND(), 0, Instant::ofEpochSecond(10), null], [Instant::ofEpochSecond(10, 200), CF::MICRO_OF_SECOND(), 100, Instant::ofEpochSecond(10, 100 * 1000), null], [Instant::ofEpochSecond(10, 200), CF::MICRO_OF_SECOND(), 0, Instant::ofEpochSecond(10), null], [Instant::ofEpochSecond(10, 200), CF::MILLI_OF_SECOND(), 100, Instant::ofEpochSecond(10, 100 * 1000 * 1000), null], [Instant::ofEpochSecond(10, 200), CF::MILLI_OF_SECOND(), 0, Instant::ofEpochSecond(10), null], [Instant::ofEpochSecond(10, 200), CF::NANO_OF_SECOND(), 1000000000, null, DateTimeException::class], [Instant::ofEpochSecond(10, 200), CF::MICRO_OF_SECOND(), 1000000, null, DateTimeException::class], [Instant::ofEpochSecond(10, 200), CF::MILLI_OF_SECOND(), 1000, null, DateTimeException::class], [Instant::ofEpochSecond(10, 200), CF::SECOND_OF_MINUTE(), 1, null, DateTimeException::class], [Instant::ofEpochSecond(10, 200), CF::SECOND_OF_DAY(), 1, null, DateTimeException::class], [Instant::ofEpochSecond(10, 200), CF::OFFSET_SECONDS(), 1, null, DateTimeException::class], [Instant::ofEpochSecond(10, 200), CF::NANO_OF_DAY(), 1, null, DateTimeException::class], [Instant::ofEpochSecond(10, 200), CF::MINUTE_OF_HOUR(), 1, null, DateTimeException::class], [Instant::ofEpochSecond(10, 200), CF::MINUTE_OF_DAY(), 1, null, DateTimeException::class], [Instant::ofEpochSecond(10, 200), CF::MILLI_OF_DAY(), 1, null, DateTimeException::class], [Instant::ofEpochSecond(10, 200), CF::MICRO_OF_DAY(), 1, null, DateTimeException::class]]; }