From d8be108c5bdac1827bda758d624bf19b7fa9cf6c Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Thu, 4 Feb 2016 14:19:14 +0100 Subject: [PATCH] Suppress PHP warning when using date_default_timezone_get() Thanks to @nem25 for reporting this --- CHANGELOG.md | 1 + lib/Pico.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d96553b..d7b4c9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Released: - * [Changed] Improve documentation * [Changed] Replace `version_compare()` with `PHP_VERSION_ID` in `index.php.dist` (available since PHP 5.2.7) +* [Fixed] Suppress PHP warning when using `date_default_timezone_get()` ``` ### Version 1.0.0 diff --git a/lib/Pico.php b/lib/Pico.php index b154a70..4ad1c3b 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -498,7 +498,7 @@ class Pico // explicitly set a default timezone to prevent a E_NOTICE // when no timezone is set; the `date_default_timezone_get()` // function always returns a timezone, at least UTC - $this->config['timezone'] = date_default_timezone_get(); + $this->config['timezone'] = @date_default_timezone_get(); } date_default_timezone_set($this->config['timezone']); }