Пример #1
0
 public function testNow()
 {
     Clock::setDefault(new FixedClock(Instant::of(123456789, 987654321)));
     $this->assertReadableInstantIs(123456789, 987654321, Instant::now());
 }
Пример #2
0
 /**
  * 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);
 }