コード例 #1
0
ファイル: InstantTest.php プロジェクト: brick/date-time
 public function testNow()
 {
     Clock::setDefault(new FixedClock(Instant::of(123456789, 987654321)));
     $this->assertReadableInstantIs(123456789, 987654321, Instant::now());
 }
コード例 #2
0
ファイル: ZonedDateTime.php プロジェクト: brick/date-time
 /**
  * Creates a DateTime representing the current time, in the given time zone.
  *
  * @param TimeZone $timeZone
  *
  * @return ZonedDateTime
  */
 public static function now(TimeZone $timeZone)
 {
     return ZonedDateTime::ofInstant(Instant::now(), $timeZone);
 }