private static function _createDateTime($time = null, $tz = null): \DateTimeImmutable
    {
        if (!isset($time)) {
            $time = 'now';
        }
        if (!isset($tz)) {
            $tz = date_default_timezone_get();
        }
        try {
            $dt = new \DateTimeImmutable($time, self::_createTimeZone($tz));
            return self::_roundDownFractionalSeconds($dt);
        } catch (\Exception $e) {
            throw new \RuntimeException(
                "Failed to create DateTime: " .
                     self::_getLastDateTimeImmutableErrorsStr(), 0, $e);
        }
    }