public function testNow() { Clock::setDefault(new FixedClock(Instant::of(123456789, 987654321))); $this->assertReadableInstantIs(123456789, 987654321, Instant::now()); }
/** * 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); }