public function test_factory_ofInstant_Instant_inGap() { $instant = $this->TEST_PARIS_GAP_2008_03_30_02_30->toInstant(self::OFFSET_0100()); $test = ZonedDateTime::ofInstant($instant, self::ZONE_PARIS()); $this->check($test, 2008, 3, 30, 3, 30, 0, 0, self::OFFSET_0200(), self::ZONE_PARIS()); // one $hour later in summer $offset }
/** * Converts this date-time to an {@code Instant}. * <p> * This returns an {@code Instant} representing the same point on the * time-line as this date-time. * * @return Instant an {@code Instant} representing the same instant, not null */ public function toInstant() { return $this->dateTime->toInstant($this->offset); }
/** * Gets the transition instant. * <p> * This is the instant of the discontinuity, which is defined as the first * instant that the 'after' offset applies. * <p> * The methods {@link #getInstant()}, {@link #getDateTimeBefore()} and {@link #getDateTimeAfter()} * all represent the same instant. * * @return Instant the transition instant, not null */ public function getInstant() { return $this->transition->toInstant($this->offsetBefore); }