src/Clock.php
static function dateTimeImmutable(?\DateTimeZone $timezone = null): \DateTimeImmutable
    {
        if (self::$now !== null) {
            $now = \DateTimeImmutable::createFromFormat('U.u', sprintf('%.6F', self::$now));
            $now = $now->setTimezone($timezone ?? new \DateTimeZone(date_default_timezone_get()));

            return $now;
        }

        return new \DateTimeImmutable('now', $timezone);
    }
static function dateTimeImmutable(?\DateTimeZone $timezone = null): \DateTimeImmutable
    {
        if (self::$now !== null) {
            $now = \DateTimeImmutable::createFromFormat('U.u', sprintf('%.6F', self::$now));
            $now = $now->setTimezone($timezone ?? new \DateTimeZone(date_default_timezone_get()));

            return $now;
        }

        return new \DateTimeImmutable('now', $timezone);
    }
static function dateTimeImmutable ( ? \ DateTimeZone $ timezone = null ) : \ DateTimeImmutable { if ( self :: $ now !== null ) { $ now = \ DateTimeImmutable :: createFromFormat ( 'U.u' , sprintf ( '%.6F' , self :: $ now ) ) ; $ now = $ now -> setTimezone ( $ timezone ?? new \ DateTimeZone ( date_default_timezone_get ( ) ) ) ; return $ now ; } return new \ DateTimeImmutable ( 'now' , $ timezone ) ; }
Get the current date-time as an immutable instance

If no time zone is specified, then the default time zone will be used.

The default time zone is specified by the date.timezone INI setting or the date_default_timezone_set() function.
Get the current date - time as an immutable instance