public function test_constant_UTC() { $test = ZoneOffset::UTC(); $this->assertEquals($test->getId(), "Z"); $this->assertEquals($test->getDisplayName(TextStyle::FULL(), Locale::UK()), "Z"); $this->assertEquals($test->getRules()->isFixedOffset(), true); $this->assertEquals($test->getRules()->getOffset(Instant::ofEpochSecond(0)), ZoneOffset::UTC()); $this->checkOffset($test->getRules(), $this->createLDT(2008, 6, 30), ZoneOffset::UTC(), 1); }
/** * Obtains an instance of {@code Instant} from a temporal object. * <p> * This obtains an instant based on the specified temporal. * A {@code TemporalAccessor} represents an arbitrary set of date and time information, * which this factory converts to an instance of {@code Instant}. * <p> * The conversion extracts the {@link ChronoField#INSTANT_SECONDS INSTANT_SECONDS} * and {@link ChronoField#NANO_OF_SECOND NANO_OF_SECOND} fields. * <p> * This method matches the signature of the functional interface {@link TemporalQuery} * allowing it to be used as a query via method reference, {@code Instant::from}. * * @param TemporalAccessor $temporal the temporal object to convert, not null * @return Instant the instant, not null * @throws DateTimeException if unable to convert to an Instant {@code Instant} */ public static function from(TemporalAccessor $temporal) { if ($temporal instanceof Instant) { return $temporal; } try { $instantSecs = $temporal->getLong(ChronoField::INSTANT_SECONDS()); $nanoOfSecond = $temporal->get(ChronoField::NANO_OF_SECOND()); return Instant::ofEpochSecond($instantSecs, $nanoOfSecond); } catch (DateTimeException $ex) { throw new DateTimeException("Unable to obtain Instant from TemporalAccessor: " . $temporal . " of type " . get_class($temporal), $ex); } }
function data_instantFactory() { return [[Instant::ofEpochSecond(86400 + 3600 + 120 + 4, 500), self::ZONE_PARIS(), LocalDateTime::of(1970, 1, 2, 2, 2, 4, 500)], [Instant::ofEpochSecond(86400 + 3600 + 120 + 4, 500), self::OFFSET_MTWO(), LocalDateTime::of(1970, 1, 1, 23, 2, 4, 500)], [Instant::ofEpochSecond(-86400 + 4, 500), self::OFFSET_PTWO(), LocalDateTime::of(1969, 12, 31, 2, 0, 4, 500)], [OffsetDateTime::ofDateTime(LocalDateTime::of(Year::MIN_VALUE, 1, 1, 0, 0), ZoneOffset::UTC())->toInstant(), ZoneOffset::UTC(), LocalDateTime::MIN()], [OffsetDateTime::ofDateTime(LocalDateTime::of(Year::MAX_VALUE, 12, 31, 23, 59, 59, 999999999), ZoneOffset::UTC())->toInstant(), ZoneOffset::UTC(), LocalDateTime::MAX()]]; }
public function test_factory_between__TemporalTemporal_endNull() { TestHelper::assertNullException($this, function () { $start = Instant::ofEpochSecond(1); Duration::between($start, null); }); }
function data_instantNoZone() { return [[self::INSTANT(), "2014-06-30T01:02:03Z", ZonedDateTime::of(2014, 6, 30, 1, 2, 3, 0, ZoneOffset::UTC())->toInstant()], [self::INSTANTSECONDS(), "86402", Instant::ofEpochSecond(86402)], [self::INSTANTSECONDS_NOS(), "86402.123456789", Instant::ofEpochSecond(86402, 123456789)]]; }
/** * @expectedException \Celest\DateTimeException */ public function test_until_invalidType() { $odt = OffsetDateTime::of(2010, 6, 30, 1, 1, 1, 0, self::OFFSET_PONE()); $odt->until(Instant::ofEpochSecond(12), CU::SECONDS()); }
/** * @group long */ public function test_factory_ofInstant_beforeEpoch() { for ($i = -1; $i >= -(24 * 60 * 60); $i--) { $instant = Instant::ofEpochSecond($i, 8); $test = OffsetTime::ofInstant($instant, ZoneOffset::UTC()); $this->assertEquals($test->getHour(), ($i + 24 * 60 * 60) / (60 * 60) % 24); $this->assertEquals($test->getMinute(), ($i + 24 * 60 * 60) / 60 % 60); $this->assertEquals($test->getSecond(), ($i + 24 * 60 * 60) % 60); $this->assertEquals($test->getNano(), 8); } }
function data_format_withZone_withChronology() { $ym = YearMonth::of(2008, 6); $ld = LocalDate::of(2008, 6, 30); $lt = LocalTime::of(11, 30); $ldt = LocalDateTime::of(2008, 6, 30, 11, 30); $ot = OffsetTime::ofLocalTime(LocalTime::of(11, 30), self::OFFSET_PONE()); $odt = OffsetDateTime::ofDateTime(LocalDateTime::of(2008, 6, 30, 11, 30), self::OFFSET_PONE()); $zdt = ZonedDateTime::ofDateTime(LocalDateTime::of(2008, 6, 30, 11, 30), self::ZONE_PARIS()); $thaiZdt = ThaiBuddhistChronology::INSTANCE()->zonedDateTimeFrom($zdt); $instant = Instant::ofEpochSecond(3600); return [[null, null, DayOfWeek::MONDAY(), "::::"], [null, null, $ym, "2008::::ISO"], [null, null, $ld, "2008::::ISO"], [null, null, $lt, ":11:::"], [null, null, $ldt, "2008:11:::ISO"], [null, null, $ot, ":11:+01:00::"], [null, null, $odt, "2008:11:+01:00::ISO"], [null, null, $zdt, "2008:11:+02:00:Europe/Paris:ISO"], [null, null, $instant, "::::"], [IsoChronology::INSTANCE(), null, DayOfWeek::MONDAY(), "::::ISO"], [IsoChronology::INSTANCE(), null, $ym, "2008::::ISO"], [IsoChronology::INSTANCE(), null, $ld, "2008::::ISO"], [IsoChronology::INSTANCE(), null, $lt, ":11:::ISO"], [IsoChronology::INSTANCE(), null, $ldt, "2008:11:::ISO"], [IsoChronology::INSTANCE(), null, $ot, ":11:+01:00::ISO"], [IsoChronology::INSTANCE(), null, $odt, "2008:11:+01:00::ISO"], [IsoChronology::INSTANCE(), null, $zdt, "2008:11:+02:00:Europe/Paris:ISO"], [IsoChronology::INSTANCE(), null, $instant, "::::ISO"], [null, self::ZONE_PARIS(), DayOfWeek::MONDAY(), ":::Europe/Paris:"], [null, self::ZONE_PARIS(), $ym, "2008:::Europe/Paris:ISO"], [null, self::ZONE_PARIS(), $ld, "2008:::Europe/Paris:ISO"], [null, self::ZONE_PARIS(), $lt, ":11::Europe/Paris:"], [null, self::ZONE_PARIS(), $ldt, "2008:11::Europe/Paris:ISO"], [null, self::ZONE_PARIS(), $ot, ":11:+01:00:Europe/Paris:"], [null, self::ZONE_PARIS(), $odt, "2008:12:+02:00:Europe/Paris:ISO"], [null, self::ZONE_PARIS(), $zdt, "2008:11:+02:00:Europe/Paris:ISO"], [null, self::ZONE_PARIS(), $instant, "1970:02:+01:00:Europe/Paris:ISO"], [null, self::OFFSET_PTHREE(), DayOfWeek::MONDAY(), ":::+03:00:"], [null, self::OFFSET_PTHREE(), $ym, "2008:::+03:00:ISO"], [null, self::OFFSET_PTHREE(), $ld, "2008:::+03:00:ISO"], [null, self::OFFSET_PTHREE(), $lt, ":11::+03:00:"], [null, self::OFFSET_PTHREE(), $ldt, "2008:11::+03:00:ISO"], [null, self::OFFSET_PTHREE(), $ot, null], [null, self::OFFSET_PTHREE(), $odt, "2008:13:+03:00:+03:00:ISO"], [null, self::OFFSET_PTHREE(), $zdt, "2008:12:+03:00:+03:00:ISO"], [null, self::OFFSET_PTHREE(), $instant, "1970:04:+03:00:+03:00:ISO"], [ThaiBuddhistChronology::INSTANCE(), null, DayOfWeek::MONDAY(), null], [ThaiBuddhistChronology::INSTANCE(), null, $ym, null], [ThaiBuddhistChronology::INSTANCE(), null, $ld, "2551::::ThaiBuddhist"], [ThaiBuddhistChronology::INSTANCE(), null, $lt, ":11:::ThaiBuddhist"], [ThaiBuddhistChronology::INSTANCE(), null, $ldt, "2551:11:::ThaiBuddhist"], [ThaiBuddhistChronology::INSTANCE(), null, $ot, ":11:+01:00::ThaiBuddhist"], [ThaiBuddhistChronology::INSTANCE(), null, $odt, "2551:11:+01:00::ThaiBuddhist"], [ThaiBuddhistChronology::INSTANCE(), null, $zdt, "2551:11:+02:00:Europe/Paris:ThaiBuddhist"], [ThaiBuddhistChronology::INSTANCE(), null, $instant, "::::ThaiBuddhist"], [ThaiBuddhistChronology::INSTANCE(), null, DayOfWeek::MONDAY(), null], [ThaiBuddhistChronology::INSTANCE(), self::ZONE_PARIS(), $ym, null], [ThaiBuddhistChronology::INSTANCE(), self::ZONE_PARIS(), $ld, "2551:::Europe/Paris:ThaiBuddhist"], [ThaiBuddhistChronology::INSTANCE(), self::ZONE_PARIS(), $lt, ":11::Europe/Paris:ThaiBuddhist"], [ThaiBuddhistChronology::INSTANCE(), self::ZONE_PARIS(), $ldt, "2551:11::Europe/Paris:ThaiBuddhist"], [ThaiBuddhistChronology::INSTANCE(), self::ZONE_PARIS(), $ot, ":11:+01:00:Europe/Paris:ThaiBuddhist"], [ThaiBuddhistChronology::INSTANCE(), self::ZONE_PARIS(), $odt, "2551:12:+02:00:Europe/Paris:ThaiBuddhist"], [ThaiBuddhistChronology::INSTANCE(), self::ZONE_PARIS(), $zdt, "2551:11:+02:00:Europe/Paris:ThaiBuddhist"], [ThaiBuddhistChronology::INSTANCE(), self::ZONE_PARIS(), $instant, "2513:02:+01:00:Europe/Paris:ThaiBuddhist"], [null, self::ZONE_PARIS(), $thaiZdt, "2551:11:+02:00:Europe/Paris:ThaiBuddhist"], [ThaiBuddhistChronology::INSTANCE(), self::ZONE_PARIS(), $thaiZdt, "2551:11:+02:00:Europe/Paris:ThaiBuddhist"], [IsoChronology::INSTANCE(), self::ZONE_PARIS(), $thaiZdt, "2008:11:+02:00:Europe/Paris:ISO"]]; }
private function resolveInstantFields0(ZoneId $selectedZone) { $instant = Instant::ofEpochSecond($this->fieldValues->remove(CF::INSTANT_SECONDS())); $zdt = $this->chrono->zonedDateTime($instant, $selectedZone); $this->updateCheckConflict1($zdt->toLocalDate()); $this->updateCheckConflict3(CF::INSTANT_SECONDS(), CF::SECOND_OF_DAY(), $zdt->toLocalTime()->toSecondOfDay()); }
public function test_parse_fromField_InstantSeconds_NanoOfSecond() { $fmt = (new DateTimeFormatterBuilder())->appendValue(ChronoField::INSTANT_SECONDS())->appendLiteral('.')->appendValue(ChronoField::NANO_OF_SECOND())->toFormatter(); $acc = $fmt->parse("86402.123456789"); $expected = Instant::ofEpochSecond(86402, 123456789); $this->assertEquals($acc->isSupported(ChronoField::INSTANT_SECONDS()), 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::INSTANT_SECONDS()), 86402); $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); $this->assertEquals(Instant::from($acc), $expected); }
/** * @inheritdoc */ public function toInstant(ZoneOffset $offset) { return Instant::ofEpochSecond($this->toEpochSecond($offset), $this->toLocalTime()->getNano()); }
/** * Obtains an instance of {@code ZonedDateTime} using seconds from the * epoch of 1970-01-01T00:00:00Z. * * @param int $epochSecond the number of seconds from the epoch of 1970-01-01T00:00:00Z * @param int $nanoOfSecond the nanosecond within the second, from 0 to 999,999,999 * @param ZoneId $zone the time-zone, not null * @return ZonedDateTime the zoned date-time, not null * @throws DateTimeException if the result exceeds the supported range */ private static function create($epochSecond, $nanoOfSecond, ZoneId $zone) { $rules = $zone->getRules(); $instant = Instant::ofEpochSecond($epochSecond, $nanoOfSecond); // TODO: rules should be queryable by epochSeconds $offset = $rules->getOffset($instant); $ldt = LocalDateTime::ofEpochSecond($epochSecond, $nanoOfSecond, $offset); return new ZonedDateTime($ldt, $offset, $zone); }
/** * @group long */ public function test_now_Clock_beforeEpoch() { for ($i = -1; $i >= -(24 * 60 * 60); $i--) { $instant = Instant::ofEpochSecond($i, 8); $clock = Clock::fixed($instant, ZoneOffset::UTC()); $test = LocalTime::nowOf($clock); $this->assertEquals($test->getHour(), ($i + 24 * 60 * 60) / (60 * 60) % 24); $this->assertEquals($test->getMinute(), ($i + 24 * 60 * 60) / 60 % 60); $this->assertEquals($test->getSecond(), ($i + 24 * 60 * 60) % 60); $this->assertEquals($test->getNano(), 8); } }
/** * @expectedException \Celest\DateTimeException */ public function test_factory_ofInstant_tooLow() { $days_0000_to_1970 = 146097 * 5 - (30 * 365 + 7); $year = Year::MIN_VALUE - 1; $days = $year * 365 + ($year / 4 - $year / 100 + $year / 400) - $days_0000_to_1970; $instant = Instant::ofEpochSecond($days * 24 * 60 * 60); ZonedDateTime::ofInstant($instant, ZoneOffset::UTC()); }
/** * @inheritdoc */ public function toInstant() { return Instant::ofEpochSecond($this->toEpochSecond(), $this->toLocalTime()->getNano()); }
/** * @dataProvider data_parse_digits */ public function test_parse_digitsNine($instantSecs, $nano, $input) { $f = (new DateTimeFormatterBuilder())->appendInstant4(9)->toFormatter(); if ($input[strlen($input) - 11] === '.') { $expected = Instant::ofEpochSecond($instantSecs, $nano); $this->assertEquals($f->parseQuery($input, Instant::fromQuery()), $expected); $this->assertEquals($f->parse($input)->query(DateTimeFormatter::parsedExcessDays()), Period::ZERO()); $this->assertEquals($f->parse($input)->query(DateTimeFormatter::parsedLeapSecond()), false); } else { try { $f->parseQuery($input, Instant::fromQuery()); $this->fail(); } catch (DateTimeException $ex) { // $expected } } }
/** * @group long */ public function test_now_Clock_allSecsInDay_beforeEpoch() { for ($i = -1; $i >= -(2 * 24 * 60 * 60); $i--) { $instant = Instant::ofEpochSecond($i); $clock = Clock::fixed($instant, ZoneOffset::UTC()); $test = LocalDate::nowOf($clock); $this->assertEquals($test->getYear(), 1969); $this->assertEquals($test->getMonth(), Month::DECEMBER()); $this->assertEquals($test->getDayOfMonth(), $i >= -24 * 60 * 60 ? 31 : 30); } }
/** * Returns a copy of this date-time with the specified field set to a new value. * <p> * This returns an {@code OffsetDateTime}, based on this one, with the value * for the specified field changed. * This can be used to change any supported field, such as the year, month or day-of-month. * 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> * In some cases, changing the specified field can cause the resulting date-time to become invalid, * such as changing the month from 31st January to February would make the day-of-month invalid. * In cases like this, the field is responsible for resolving the date. Typically it will choose * the previous valid date, which would be the last valid day of February in this example. * <p> * If the field is a {@link ChronoField} then the adjustment is implemented here. * <p> * The {@code INSTANT_SECONDS} field will return a date-time with the specified instant. * The offset and nano-of-second are unchanged. * If the new instant value is outside the valid range then a {@code DateTimeException} will be thrown. * <p> * The {@code OFFSET_SECONDS} field will return a date-time with the specified offset. * The local date-time is unaltered. If the new offset value is outside the valid range * then a {@code DateTimeException} will be thrown. * <p> * The other {@link #isSupported(TemporalField) supported fields} will behave as per * the matching method on {@link LocalDateTime#with(TemporalField, long) LocalDateTime}. * In this case, the offset is not part of the calculation and will be unchanged. * <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 OffsetDateTime an {@code OffsetDateTime} 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; switch ($f) { case ChronoField::INSTANT_SECONDS(): return $this->ofInstant(Instant::ofEpochSecond($newValue, $this->getNano()), $this->offset); case ChronoField::OFFSET_SECONDS(): return $this->_with($this->dateTime, ZoneOffset::ofTotalSeconds($f->checkValidIntValue($newValue))); } return $this->_with($this->dateTime->with($field, $newValue), $this->offset); } return $field->adjustInto($this, $newValue); }
function data_toString() { return [[Instant::ofEpochSecond(65, 567), "1970-01-01T00:01:05.000000567Z"], [Instant::ofEpochSecond(65, 560), "1970-01-01T00:01:05.000000560Z"], [Instant::ofEpochSecond(65, 560000), "1970-01-01T00:01:05.000560Z"], [Instant::ofEpochSecond(65, 560000000), "1970-01-01T00:01:05.560Z"], [Instant::ofEpochSecond(1, 0), "1970-01-01T00:00:01Z"], [Instant::ofEpochSecond(60, 0), "1970-01-01T00:01:00Z"], [Instant::ofEpochSecond(3600, 0), "1970-01-01T01:00:00Z"], [Instant::ofEpochSecond(-1, 0), "1969-12-31T23:59:59Z"], [LocalDateTime::of(0, 1, 2, 0, 0)->toInstant(ZoneOffset::UTC()), "0000-01-02T00:00:00Z"], [LocalDateTime::of(0, 1, 1, 12, 30)->toInstant(ZoneOffset::UTC()), "0000-01-01T12:30:00Z"], [LocalDateTime::of(0, 1, 1, 0, 0, 0, 1)->toInstant(ZoneOffset::UTC()), "0000-01-01T00:00:00.000000001Z"], [LocalDateTime::of(0, 1, 1, 0, 0)->toInstant(ZoneOffset::UTC()), "0000-01-01T00:00:00Z"], [LocalDateTime::of(-1, 12, 31, 23, 59, 59, 999999999)->toInstant(ZoneOffset::UTC()), "-0001-12-31T23:59:59.999999999Z"], [LocalDateTime::of(-1, 12, 31, 12, 30)->toInstant(ZoneOffset::UTC()), "-0001-12-31T12:30:00Z"], [LocalDateTime::of(-1, 12, 30, 12, 30)->toInstant(ZoneOffset::UTC()), "-0001-12-30T12:30:00Z"], [LocalDateTime::of(-9999, 1, 2, 12, 30)->toInstant(ZoneOffset::UTC()), "-9999-01-02T12:30:00Z"], [LocalDateTime::of(-9999, 1, 1, 12, 30)->toInstant(ZoneOffset::UTC()), "-9999-01-01T12:30:00Z"], [LocalDateTime::of(-9999, 1, 1, 0, 0)->toInstant(ZoneOffset::UTC()), "-9999-01-01T00:00:00Z"], [LocalDateTime::of(-10000, 12, 31, 23, 59, 59, 999999999)->toInstant(ZoneOffset::UTC()), "-10000-12-31T23:59:59.999999999Z"], [LocalDateTime::of(-10000, 12, 31, 12, 30)->toInstant(ZoneOffset::UTC()), "-10000-12-31T12:30:00Z"], [LocalDateTime::of(-10000, 12, 30, 12, 30)->toInstant(ZoneOffset::UTC()), "-10000-12-30T12:30:00Z"], [LocalDateTime::of(-15000, 12, 31, 12, 30)->toInstant(ZoneOffset::UTC()), "-15000-12-31T12:30:00Z"], [LocalDateTime::of(-19999, 1, 2, 12, 30)->toInstant(ZoneOffset::UTC()), "-19999-01-02T12:30:00Z"], [LocalDateTime::of(-19999, 1, 1, 12, 30)->toInstant(ZoneOffset::UTC()), "-19999-01-01T12:30:00Z"], [LocalDateTime::of(-19999, 1, 1, 0, 0)->toInstant(ZoneOffset::UTC()), "-19999-01-01T00:00:00Z"], [LocalDateTime::of(-20000, 12, 31, 23, 59, 59, 999999999)->toInstant(ZoneOffset::UTC()), "-20000-12-31T23:59:59.999999999Z"], [LocalDateTime::of(-20000, 12, 31, 12, 30)->toInstant(ZoneOffset::UTC()), "-20000-12-31T12:30:00Z"], [LocalDateTime::of(-20000, 12, 30, 12, 30)->toInstant(ZoneOffset::UTC()), "-20000-12-30T12:30:00Z"], [LocalDateTime::of(-25000, 12, 31, 12, 30)->toInstant(ZoneOffset::UTC()), "-25000-12-31T12:30:00Z"], [LocalDateTime::of(9999, 12, 30, 12, 30)->toInstant(ZoneOffset::UTC()), "9999-12-30T12:30:00Z"], [LocalDateTime::of(9999, 12, 31, 12, 30)->toInstant(ZoneOffset::UTC()), "9999-12-31T12:30:00Z"], [LocalDateTime::of(9999, 12, 31, 23, 59, 59, 999999999)->toInstant(ZoneOffset::UTC()), "9999-12-31T23:59:59.999999999Z"], [LocalDateTime::of(10000, 1, 1, 0, 0)->toInstant(ZoneOffset::UTC()), "+10000-01-01T00:00:00Z"], [LocalDateTime::of(10000, 1, 1, 12, 30)->toInstant(ZoneOffset::UTC()), "+10000-01-01T12:30:00Z"], [LocalDateTime::of(10000, 1, 2, 12, 30)->toInstant(ZoneOffset::UTC()), "+10000-01-02T12:30:00Z"], [LocalDateTime::of(15000, 12, 31, 12, 30)->toInstant(ZoneOffset::UTC()), "+15000-12-31T12:30:00Z"], [LocalDateTime::of(19999, 12, 30, 12, 30)->toInstant(ZoneOffset::UTC()), "+19999-12-30T12:30:00Z"], [LocalDateTime::of(19999, 12, 31, 12, 30)->toInstant(ZoneOffset::UTC()), "+19999-12-31T12:30:00Z"], [LocalDateTime::of(19999, 12, 31, 23, 59, 59, 999999999)->toInstant(ZoneOffset::UTC()), "+19999-12-31T23:59:59.999999999Z"], [LocalDateTime::of(20000, 1, 1, 0, 0)->toInstant(ZoneOffset::UTC()), "+20000-01-01T00:00:00Z"], [LocalDateTime::of(20000, 1, 1, 12, 30)->toInstant(ZoneOffset::UTC()), "+20000-01-01T12:30:00Z"], [LocalDateTime::of(20000, 1, 2, 12, 30)->toInstant(ZoneOffset::UTC()), "+20000-01-02T12:30:00Z"], [LocalDateTime::of(25000, 12, 31, 12, 30)->toInstant(ZoneOffset::UTC()), "+25000-12-31T12:30:00Z"], [LocalDateTime::of(-999999999, 1, 1, 12, 30)->toInstant(ZoneOffset::UTC())->minus(1, CU::DAYS()), "-1000000000-12-31T12:30:00Z"], [LocalDateTime::of(999999999, 12, 31, 12, 30)->toInstant(ZoneOffset::UTC())->plus(1, CU::DAYS()), "+1000000000-01-01T12:30:00Z"], [Instant::MIN(), "-1000000000-01-01T00:00:00Z"], [Instant::MAX(), "+1000000000-12-31T23:59:59.999999999Z"]]; }