public static function getTimezone()
    {
        // Suppress the PHP warning, "It is not safe to rely on the system's
        // timezone settings".
        $currentTz = @date_default_timezone_get();
        if ($currentTz !== 'UTC') {
            return $currentTz;
        }

        if (ini_get('date.timezone')) {
            return ini_get('date.timezone');
        }

        if (getenv('TZ')) {
            return (string) getenv('TZ');
        }

        if ($systemTz = self::detectSystemTimezone()) {
            return $systemTz;
        }

        return $currentTz;
    }
public static function getTimezone()
    {
        // Suppress the PHP warning, "It is not safe to rely on the system's
        // timezone settings".
        $currentTz = @date_default_timezone_get();
        if ($currentTz !== 'UTC') {
            return $currentTz;
        }

        if (ini_get('date.timezone')) {
            return ini_get('date.timezone');
        }

        if (getenv('TZ')) {
            return (string) getenv('TZ');
        }

        if ($systemTz = self::detectSystemTimezone()) {
            return $systemTz;
        }

        return $currentTz;
    }
public static function getTimezone ( ) { // Suppress the PHP warning, "It is not safe to rely on the system's // timezone settings". $ currentTz = @ date_default_timezone_get ( ) ; if ( $ currentTz !== 'UTC' ) { return $ currentTz ; } if ( ini_get ( 'date.timezone' ) ) { return ini_get ( 'date.timezone' ) ; } if ( getenv ( 'TZ' ) ) { return ( string ) getenv ( 'TZ' ) ; } if ( $ systemTz = self :: detectSystemTimezone ( ) ) { return $ systemTz ; } return $ currentTz ; }
Get the timezone intended by the user.

The timezone is detected with the following priorities:

1. A value previously set via date_default_timezone_set(), which can
only be known if it is not the default, UTC.
2. The value of the ini setting 'date.timezone'.
3. The value of the TZ environment variable, if set.
4. A best guess at the system timezone: see self::detectSystemTimezone().
5. Default to the value of date_default_timezone_get(), which at this
stage will almost definitely be UTC.

@return string
Get the timezone intended by the user .