stripTime($time, $tz); parent::__construct($time); return; } $testNow = clone $testNow; if ($tz !== $testNow->getTimezone()) { $testNow = $testNow->setTimezone($tz ?? date_default_timezone_get()); } if (!empty($time)) { $testNow = $testNow->modify($time); } $time = $testNow->format('Y-m-d 00:00:00'); parent::__construct($time); } /** * Create a new mutable instance from current immutable instance. * * @return \Cake\Chronos\MutableDate */ public function toMutable(): MutableDate { return MutableDate::instance($this); } /** * Return properties for debugging. * * @return array */ public function __debugInfo(): array { $properties = [ 'hasFixedNow' => static::hasTestNow(), 'date' => $this->format('Y-m-d'), ]; return $properties; } }