Piwik\SettingsServer::isTimezoneSupportEnabled PHP Method

isTimezoneSupportEnabled() public static method

Returns true if this PHP version/build supports timezone manipulation (e.g., php >= 5.2, or compiled with **EXPERIMENTAL_DATE_SUPPORT=1** for php < 5.2).
public static isTimezoneSupportEnabled ( ) : boolean
return boolean
    public static function isTimezoneSupportEnabled()
    {
        return function_exists('date_create') && function_exists('date_default_timezone_set') && function_exists('timezone_identifiers_list') && function_exists('timezone_open') && function_exists('timezone_offset_get');
    }

Usage Example

Example #1
0
 public function execute()
 {
     $label = $this->translator->translate('SitesManager_Timezone');
     if (SettingsServer::isTimezoneSupportEnabled()) {
         return array(DiagnosticResult::singleResult($label, DiagnosticResult::STATUS_OK));
     }
     $comment = sprintf('%s<br />%s.', $this->translator->translate('SitesManager_AdvancedTimezoneSupportNotFound'), '<a href="http://php.net/manual/en/datetime.installation.php" rel="noreferrer" target="_blank">Timezone PHP documentation</a>');
     return array(DiagnosticResult::singleResult($label, DiagnosticResult::STATUS_WARNING, $comment));
 }
All Usage Examples Of Piwik\SettingsServer::isTimezoneSupportEnabled