コード例 #1
0
 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
 }
コード例 #2
0
 /**
  * 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);
 }
コード例 #3
0
 /**
  * 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);
 }