Example #1
0
 public function test_now_Clock()
 {
     $instant = OffsetDateTime::ofDateAndTime(LocalDate::of(2010, 12, 31), LocalTime::of(0, 0), ZoneOffset::UTC())->toInstant();
     $clock = Clock::fixed($instant, ZoneOffset::UTC());
     $test = Year::nowof($clock);
     $this->assertEquals($test->getValue(), 2010);
 }
 public function test_of()
 {
     //used for standard offset
     $stdOffset1 = ZoneOffset::UTC();
     $stdOffset2 = ZoneOffset::ofHours(1);
     $time_of_stdOffsetTransition1 = LocalDateTime::of(2013, 1, 5, 1, 0);
     $stdOffsetTransition1 = ZoneOffsetTransition::of($time_of_stdOffsetTransition1, $stdOffset1, $stdOffset2);
     $stdOffsetTransition_list = [];
     $stdOffsetTransition_list[] = $stdOffsetTransition1;
     //used for wall offset
     $wallOffset1 = ZoneOffset::ofHours(2);
     $wallOffset2 = ZoneOffset::ofHours(4);
     $wallOffset3 = ZoneOffset::ofHours(7);
     $time_of_wallOffsetTransition1 = LocalDateTime::of(2013, 2, 5, 1, 0);
     $time_of_wallOffsetTransition2 = LocalDateTime::of(2013, 3, 5, 1, 0);
     $time_of_wallOffsetTransition3 = LocalDateTime::of(2013, 10, 5, 1, 0);
     $wallOffsetTransition1 = ZoneOffsetTransition::of($time_of_wallOffsetTransition1, $wallOffset1, $wallOffset2);
     $wallOffsetTransition2 = ZoneOffsetTransition::of($time_of_wallOffsetTransition2, $wallOffset2, $wallOffset3);
     $wallOffsetTransition3 = ZoneOffsetTransition::of($time_of_wallOffsetTransition3, $wallOffset3, $wallOffset1);
     $wallOffsetTransition_list = [];
     $wallOffsetTransition_list[] = $wallOffsetTransition1;
     $wallOffsetTransition_list[] = $wallOffsetTransition2;
     $wallOffsetTransition_list[] = $wallOffsetTransition3;
     //used for ZoneOffsetTransitionRule
     $ruleOffset = ZoneOffset::ofHours(3);
     $timeDefinition = TimeDefinition::WALL();
     $rule1 = ZoneOffsetTransitionRule::of(Month::FEBRUARY(), 2, DayOfWeek::MONDAY(), LocalTime::of(1, 0), false, $timeDefinition, ZoneOffset::UTC(), ZoneOffset::UTC(), $ruleOffset);
     $rule_list = [];
     $rule_list[] = $rule1;
     //Begin verification
     $zoneRule = ZoneRules::of($stdOffset1, $wallOffset1, $stdOffsetTransition_list, $wallOffsetTransition_list, $rule_list);
     $before_time_of_stdOffsetTransition1 = OffsetDateTime::ofDateTime($time_of_stdOffsetTransition1, $stdOffset1)->minusSeconds(1);
     $after_time_of_stdOffsetTransition1 = OffsetDateTime::ofDateTime($time_of_stdOffsetTransition1, $stdOffset1)->plusSeconds(1);
     $this->assertEquals($zoneRule->getStandardOffset($before_time_of_stdOffsetTransition1->toInstant()), $stdOffset1);
     $this->assertEquals($zoneRule->getStandardOffset($after_time_of_stdOffsetTransition1->toInstant()), $stdOffset2);
     $before_time_of_wallOffsetTransition1 = OffsetDateTime::ofDateTime($time_of_wallOffsetTransition1, $wallOffset1)->minusSeconds(1);
     $after_time_of_wallOffsetTransition1 = OffsetDateTime::ofDateTime($time_of_wallOffsetTransition1, $wallOffset1)->plusSeconds(1);
     $this->assertEquals($zoneRule->nextTransition($before_time_of_wallOffsetTransition1->toInstant()), $wallOffsetTransition1);
     $this->assertEquals($zoneRule->nextTransition($after_time_of_wallOffsetTransition1->toInstant()), $wallOffsetTransition2);
     $before_time_of_wallOffsetTransition2 = OffsetDateTime::ofDateTime($time_of_wallOffsetTransition2, $wallOffset2)->minusSeconds(1);
     $after_time_of_wallOffsetTransition2 = OffsetDateTime::ofDateTime($time_of_wallOffsetTransition2, $wallOffset2)->plusSeconds(1);
     $this->assertEquals($zoneRule->nextTransition($before_time_of_wallOffsetTransition2->toInstant()), $wallOffsetTransition2);
     $this->assertEquals($zoneRule->nextTransition($after_time_of_wallOffsetTransition2->toInstant()), $wallOffsetTransition3);
     $before_time_of_wallOffsetTransition3 = OffsetDateTime::ofDateTime($time_of_wallOffsetTransition3, $wallOffset3)->minusSeconds(1);
     $after_time_of_wallOffsetTransition3 = OffsetDateTime::ofDateTime($time_of_wallOffsetTransition3, $wallOffset3)->plusSeconds(1);
     $this->assertEquals($zoneRule->nextTransition($before_time_of_wallOffsetTransition3->toInstant()), $wallOffsetTransition3);
     $this->assertEquals($zoneRule->nextTransition($after_time_of_wallOffsetTransition3->toInstant()), $rule1->createTransition(2014));
 }
 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"]];
 }
Example #4
0
 /**
  * Combines this date with an offset time to create an {@code OffsetDateTime}.
  * <p>
  * This returns an {@code OffsetDateTime} formed from this date at the specified time.
  * All possible combinations of date and time are valid.
  *
  * @param OffsetTime $time the time to combine with, not null
  * @return OffsetDateTime the offset date-time formed from this date and the specified time, not null
  */
 public function atOffsetTime(OffsetTime $time)
 {
     return OffsetDateTime::ofDateTime(LocalDateTime::ofDateAndTime($this, $time->toLocalTime()), $time->getOffset());
 }
 public function test_parse_leapSecond()
 {
     $expected = OffsetDateTime::of(1970, 2, 3, 23, 59, 59, 123456789, ZoneOffset::UTC())->toInstant();
     $f = (new DateTimeFormatterBuilder())->appendInstant4(-1)->toFormatter();
     foreach (ResolverStyle::values() as $style) {
         $pared = $f->withResolverStyle($style)->parse("1970-02-03T23:59:60.123456789Z");
         $this->assertEquals($pared->query(Instant::fromQuery()), $expected);
         $this->assertEquals($pared->query(DateTimeFormatter::parsedExcessDays()), Period::ZERO());
         $this->assertEquals($pared->query(DateTimeFormatter::parsedLeapSecond()), true);
     }
 }
 public function test_toOffsetDateTime()
 {
     $this->assertEquals($this->TEST_DATE_TIME->toOffsetDateTime(), OffsetDateTime::ofDateTime($this->TEST_DATE_TIME->toLocalDateTime(), $this->TEST_DATE_TIME->getOffset()));
 }
Example #7
0
 /**
  * Combines this instant with an offset to create an {@code OffsetDateTime}.
  * <p>
  * This returns an {@code OffsetDateTime} formed from this instant at the
  * specified offset from UTC/Greenwich. An exception will be thrown if the
  * instant is too large to fit into an offset date-time.
  * <p>
  * This method is equivalent to
  * {@link OffsetDateTime#ofInstant(Instant, ZoneId) OffsetDateTime.ofInstant(this, offset)}.
  *
  * @param ZoneOffset $offset the offset to combine with, not null
  * @return OffsetDateTime the offset date-time formed from this instant and the specified offset, not null
  * @throws DateTimeException if the result exceeds the supported range
  */
 public function atOffset(ZoneOffset $offset)
 {
     return OffsetDateTime::ofInstant($this, $offset);
 }
Example #8
0
 /**
  * Combines this time with a date to create an {@code OffsetDateTime}.
  * <p>
  * This returns an {@code OffsetDateTime} formed from this time and the specified date.
  * All possible combinations of date and time are valid.
  *
  * @param LocalDate $date the date to combine with, not null
  * @return OffsetDateTime the offset date-time formed from this time and the specified date, not null
  */
 public function atDate(LocalDate $date)
 {
     return OffsetDateTime::ofDateAndTime($date, $this->time, $this->offset);
 }
 /**
  * @dataProvider provider_sampleToString
  */
 public function test_toString($y, $o, $d, $h, $m, $s, $n, $offsetId, $expected)
 {
     $t = OffsetDateTime::of($y, $o, $d, $h, $m, $s, $n, ZoneOffset::of($offsetId));
     $str = $t->__toString();
     $this->assertEquals($str, $expected);
 }
 public function test_atTime_OffsetTime()
 {
     $t = LocalDate::of(2008, 6, 30);
     $this->assertEquals($t->atOffsetTime(OffsetTime::of(11, 30, 0, 0, self::OFFSET_PONE())), OffsetDateTime::of(2008, 6, 30, 11, 30, 0, 0, self::OFFSET_PONE()));
 }
 /**
  * @dataProvider data_print_localized
  */
 public function test_print_localized(TextStyle $style, LocalDateTime $ldt, ZoneOffset $offset, $expected)
 {
     $odt = OffsetDateTime::ofDateTime($ldt, $offset);
     $zdt = $ldt->atZone($offset);
     $f = (new DateTimeFormatterBuilder())->appendLocalizedOffset($style)->toFormatter();
     $this->assertEquals($f->format($odt), $expected);
     $this->assertEquals($f->format($zdt), $expected);
     $this->assertEquals($f->parseQuery($expected, TemporalQueries::fromCallable([ZoneOffset::class, 'from'])), $offset);
     if ($style == TextStyle::FULL()) {
         $f = (new DateTimeFormatterBuilder())->appendPattern("ZZZZ")->toFormatter();
         $this->assertEquals($f->format($odt), $expected);
         $this->assertEquals($f->format($zdt), $expected);
         $this->assertEquals($f->parseQuery($expected, TemporalQueries::fromCallable([ZoneOffset::class, 'from'])), $offset);
         $f = (new DateTimeFormatterBuilder())->appendPattern("OOOO")->toFormatter();
         $this->assertEquals($f->format($odt), $expected);
         $this->assertEquals($f->format($zdt), $expected);
         $this->assertEquals($f->parseQuery($expected, TemporalQueries::fromCallable([ZoneOffset::class, 'from'])), $offset);
     }
     if ($style == TextStyle::SHORT()) {
         $f = (new DateTimeFormatterBuilder())->appendPattern("O")->toFormatter();
         $this->assertEquals($f->format($odt), $expected);
         $this->assertEquals($f->format($zdt), $expected);
         $this->assertEquals($f->parseQuery($expected, TemporalQueries::fromCallable([ZoneOffset::class, 'from'])), $offset);
     }
 }
Example #12
0
 /**
  * Converts this date-time to an {@code OffsetDateTime}.
  * <p>
  * This creates an offset date-time using the local date-time and offset.
  * The zone ID is ignored.
  *
  * @return OffsetDateTime an offset date-time representing the same local date-time and offset, not null
  */
 public function toOffsetDateTime()
 {
     return OffsetDateTime::ofDateTime($this->dateTime, $this->offset);
 }
 function data_adjustInto()
 {
     return [[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, self::OFFSET_PTWO()), OffsetTime::of(23, 5, 0, 0, self::OFFSET_PTWO()), null], [LocalTime::of(23, 5), OffsetDateTime::of(2210, 2, 2, 1, 1, 0, 0, self::OFFSET_PTWO()), OffsetDateTime::of(2210, 2, 2, 23, 5, 0, 0, self::OFFSET_PTWO()), null], [LocalTime::of(23, 5), ZonedDateTime::of(2210, 2, 2, 1, 1, 0, 0, self::ZONE_PARIS()), ZonedDateTime::of(2210, 2, 2, 23, 5, 0, 0, self::ZONE_PARIS()), null], [LocalTime::of(23, 5), LocalDate::of(2210, 2, 2), null, DateTimeException::class]];
 }
 function data_adjustInto()
 {
     return [[OffsetTime::ofLocalTime(LocalTime::of(23, 5), self::OFFSET_PONE()), OffsetTime::ofLocalTime(LocalTime::of(1, 1, 1, 100), ZoneOffset::UTC()), OffsetTime::ofLocalTime(LocalTime::of(23, 5), self::OFFSET_PONE()), null], [OffsetTime::ofLocalTime(LocalTime::of(23, 5), self::OFFSET_PONE()), OffsetTime::MAX(), OffsetTime::ofLocalTime(LocalTime::of(23, 5), self::OFFSET_PONE()), null], [OffsetTime::ofLocalTime(LocalTime::of(23, 5), self::OFFSET_PONE()), OffsetTime::MIN(), OffsetTime::ofLocalTime(LocalTime::of(23, 5), self::OFFSET_PONE()), null], [OffsetTime::MAX(), OffsetTime::ofLocalTime(LocalTime::of(23, 5), self::OFFSET_PONE()), OffsetTime::ofLocalTime(OffsetTime::MAX()->toLocalTime(), ZoneOffset::ofHours(-18)), null], [OffsetTime::MIN(), OffsetTime::ofLocalTime(LocalTime::of(23, 5), self::OFFSET_PONE()), OffsetTime::ofLocalTime(OffsetTime::MIN()->toLocalTime(), ZoneOffset::ofHours(18)), null], [OffsetTime::ofLocalTime(LocalTime::of(23, 5), self::OFFSET_PONE()), ZonedDateTime::ofDateTime(LocalDateTime::of(2012, 3, 4, 1, 1, 1, 100), self::ZONE_GAZA()), ZonedDateTime::ofDateTime(LocalDateTime::of(2012, 3, 4, 23, 5), self::ZONE_GAZA()), null], [OffsetTime::ofLocalTime(LocalTime::of(23, 5), self::OFFSET_PONE()), OffsetDateTime::ofDateTime(LocalDateTime::of(2012, 3, 4, 1, 1, 1, 100), ZoneOffset::UTC()), OffsetDateTime::ofDateTime(LocalDateTime::of(2012, 3, 4, 23, 5), self::OFFSET_PONE()), null], [OffsetTime::ofLocalTime(LocalTime::of(23, 5), self::OFFSET_PONE()), LocalDateTime::of(2012, 3, 4, 1, 1, 1, 100), null, DateTimeException::class], [OffsetTime::ofLocalTime(LocalTime::of(23, 5), self::OFFSET_PONE()), LocalDate::of(2210, 2, 2), null, DateTimeException::class], [OffsetTime::ofLocalTime(LocalTime::of(23, 5), self::OFFSET_PONE()), LocalTime::of(22, 3, 0), null, DateTimeException::class]];
 }
Example #15
0
 /**
  * Checks if the instant of this date-time is equal to that of the specified date-time.
  * <p>
  * This method differs from the comparison in {@link #compareTo} and {@link #equals}
  * in that it only compares the instant of the date-time. This is equivalent to using
  * {@code dateTime1.toInstant().equals(dateTime2.toInstant());}.
  *
  * @param OffsetDateTime $other the other date-time to compare to, not null
  * @return true if the instant equals the instant of the specified date-time
  */
 public function isEqual(OffsetDateTime $other)
 {
     return $this->toEpochSecond() == $other->toEpochSecond() && $this->toLocalTime()->getNano() == $other->toLocalTime()->getNano();
 }
 public function test_atOffset()
 {
     $t = LocalDateTime::of(2008, 6, 30, 11, 30);
     $this->assertEquals($t->atOffset(self::OFFSET_PTWO()), OffsetDateTime::ofDateTime(LocalDateTime::of(2008, 6, 30, 11, 30), self::OFFSET_PTWO()));
 }
 public function test_adjustInto_OffsetDateTime()
 {
     $base = ZoneOffset::ofHoursMinutesSeconds(1, 1, 1);
     for ($i = -18; $i <= 18; $i++) {
         $offsetDateTime_target = OffsetDateTime::ofDateAndTime(LocalDate::of(1909, 2, 2), LocalTime::of(10, 10, 10), ZoneOffset::ofHours($i));
         $offsetDateTime_result = $base->adjustInto($offsetDateTime_target);
         $this->assertEquals($base, $offsetDateTime_result->getOffset());
         //Do not change $offset of ZonedDateTime after adjustInto()
         $zonedDateTime_target = $offsetDateTime_target->toZonedDateTime();
         $zonedDateTime_result = $base->adjustInto($zonedDateTime_target);
         $this->assertEquals($zonedDateTime_target->getOffset(), $zonedDateTime_result->getOffset());
     }
 }
Example #18
0
 function data_adjustInto()
 {
     return [[Instant::ofEpochSecond(10, 200), Instant::ofEpochSecond(20), Instant::ofEpochSecond(10, 200), null], [Instant::ofEpochSecond(10, -200), Instant::now(), Instant::ofEpochSecond(10, -200), null], [Instant::ofEpochSecond(-10), Instant::EPOCH(), Instant::ofEpochSecond(-10), null], [Instant::ofEpochSecond(10), Instant::MIN(), Instant::ofEpochSecond(10), null], [Instant::ofEpochSecond(10), Instant::MAX(), Instant::ofEpochSecond(10), null], [Instant::ofEpochSecond(10, 200), LocalDateTime::of(1970, 1, 1, 0, 0, 20)->toInstant(ZoneOffset::UTC()), Instant::ofEpochSecond(10, 200), null], [Instant::ofEpochSecond(10, 200), OffsetDateTime::of(1970, 1, 1, 0, 0, 20, 10, ZoneOffset::UTC()), OffsetDateTime::of(1970, 1, 1, 0, 0, 10, 200, ZoneOffset::UTC()), null], [Instant::ofEpochSecond(10, 200), OffsetDateTime::of(1970, 1, 1, 0, 0, 20, 10, self::OFFSET_PTWO()), OffsetDateTime::of(1970, 1, 1, 2, 0, 10, 200, self::OFFSET_PTWO()), null], [Instant::ofEpochSecond(10, 200), ZonedDateTime::of(1970, 1, 1, 0, 0, 20, 10, self::ZONE_PARIS()), ZonedDateTime::of(1970, 1, 1, 1, 0, 10, 200, self::ZONE_PARIS()), null], [Instant::ofEpochSecond(10, 200), LocalDateTime::of(1970, 1, 1, 0, 0, 20), null, DateTimeException::class]];
 }