コード例 #1
0
ファイル: TimeZoneRegion.php プロジェクト: brick/date-time
 /**
  * {@inheritdoc}
  */
 public function getOffset(ReadableInstant $instant)
 {
     $dateTime = new \DateTime('@' . $instant->getEpochSecond(), new \DateTimeZone('UTC'));
     return $this->zone->getOffset($dateTime);
 }
コード例 #2
0
ファイル: AbstractTestCase.php プロジェクト: brick/date-time
 /**
  * @param integer         $epochSecond The expected epoch second.
  * @param integer         $nano        The expected nanosecond adjustment.
  * @param ReadableInstant $instant     The instant to test.
  */
 protected function assertReadableInstantIs($epochSecond, $nano, ReadableInstant $instant)
 {
     $this->compare([$epochSecond, $nano], [$instant->getEpochSecond(), $instant->getNano()]);
 }