concrete/src/Localization/Service/Date.php
public function getTimezoneID($timezone)
    {
        $app = Facade::getFacadeApplication();
        /** @var Repository $config */
        $config = $app->make('config');

        switch ($timezone) {
            case 'system':
                $timezone = $config->get('app.server_timezone', @date_default_timezone_get() ?: 'UTC');
                break;
            case 'app':
                /** @var Site $site */
                $site = $app->make('site')->getSite();
                $timezone = $site->getConfigRepository()->get('timezone', @date_default_timezone_get() ?: 'UTC');
                break;
            case 'user':
                $tz = null;
                if ($config->get('concrete.misc.user_timezones')) {
                    $u = null;
                    $request = null;
                    if (!$app->isRunThroughCommandLineInterface()) {
                        $request = Request::getInstance();
                    }
                    if ($request && $request->hasCustomRequestUser()) {
                        $u = $request->getCustomRequestUser();
                    } else {
                        $u = new User();
                    }
                    if (is_object($u) && $u->isRegistered()) {
                        $tz = $u->getUserTimezone();
                    }
                }
                if ($tz) {
                    $timezone = $tz;
                } else {
                    $timezone = $this->getTimezoneID('app');
                }
                break;
        }

        return $timezone;
    }
public function getTimezoneID($timezone)
    {
        $app = Facade::getFacadeApplication();
        /** @var Repository $config */
        $config = $app->make('config');

        switch ($timezone) {
            case 'system':
                $timezone = $config->get('app.server_timezone', @date_default_timezone_get() ?: 'UTC');
                break;
            case 'app':
                /** @var Site $site */
                $site = $app->make('site')->getSite();
                $timezone = $site->getConfigRepository()->get('timezone', @date_default_timezone_get() ?: 'UTC');
                break;
            case 'user':
                $tz = null;
                if ($config->get('concrete.misc.user_timezones')) {
                    $u = null;
                    $request = null;
                    if (!$app->isRunThroughCommandLineInterface()) {
                        $request = Request::getInstance();
                    }
                    if ($request && $request->hasCustomRequestUser()) {
                        $u = $request->getCustomRequestUser();
                    } else {
                        $u = new User();
                    }
                    if (is_object($u) && $u->isRegistered()) {
                        $tz = $u->getUserTimezone();
                    }
                }
                if ($tz) {
                    $timezone = $tz;
                } else {
                    $timezone = $this->getTimezoneID('app');
                }
                break;
        }

        return $timezone;
    }
public function getTimezoneID ( $ timezone ) { $ app = Facade :: getFacadeApplication ( ) ; /** @var Repository $config */ $ config = $ app -> make ( 'config' ) ; switch ( $ timezone ) { case 'system' : $ timezone = $ config -> get ( 'app.server_timezone' , @ date_default_timezone_get ( ) ? : 'UTC' ) ; break ; case 'app' : /** @var Site $site */ $ site = $ app -> make ( 'site' ) -> getSite ( ) ; $ timezone = $ site -> getConfigRepository ( ) -> get ( 'timezone' , @ date_default_timezone_get ( ) ? : 'UTC' ) ; break ; case 'user' : $ tz = null ; if ( $ config -> get ( 'concrete.misc.user_timezones' ) ) { $ u = null ; $ request = null ; if ( ! $ app -> isRunThroughCommandLineInterface ( ) ) { $ request = Request :: getInstance ( ) ; } if ( $ request && $ request -> hasCustomRequestUser ( ) ) { $ u = $ request -> getCustomRequestUser ( ) ; } else { $ u = new User ( ) ; } if ( is_object ( $ u ) && $ u -> isRegistered ( ) ) { $ tz = $ u -> getUserTimezone ( ) ; } } if ( $ tz ) { $ timezone = $ tz ; } else { $ timezone = $ this -> getTimezoneID ( 'app' ) ; } break ; } return $ timezone ; }
Returns the normalized timezone identifier.

@param string $timezone The timezone to retrieve. Special values are:<ul>
<li>'system' (default) for the current system timezone</li>
<li>'user' for the user's timezone</li>
<li>'app' for the app's timezone</li>
<li>Other values: one of the PHP supported time zones (see http://us1.php.net/manual/en/timezones.php )</li>
</ul>

@return string
Returns the normalized timezone identifier .