From e60cefc43b7aa054ea430595e26e6dc7dc8b136d Mon Sep 17 00:00:00 2001 From: ruan Date: Sun, 8 Jan 2017 08:23:10 +0200 Subject: [PATCH] Use UTC for strftime testing --- inc/settings.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/inc/settings.php b/inc/settings.php index 64d123d..d1fac4f 100644 --- a/inc/settings.php +++ b/inc/settings.php @@ -63,7 +63,9 @@ final class Settings { // https://secure.php.net/manual/en/function.strftime.php // Example output of default format: July 2, 2015, 09:19; August 4, 2016, 18:37 $this->date_format = '%B %d, %Y, %R'; - date_default_timezone_set("UTC"); + + // https://secure.php.net/manual/en/timezones.php + $timezone = "UTC"; // Enable PHP error reporting. $this->error_reporting = true; @@ -111,7 +113,11 @@ final class Settings { $this->active_query = "WHERE active=" . Settings::$TRUE; } + // test strftime + + date_default_timezone_set("UTC"); // temporarily set UTC timezone for testing purposes + $fail = false; $test = strftime($this->date_format, 0); if ($test == false) { @@ -136,6 +142,8 @@ final class Settings { die; } + date_default_timezone_set($timezone); // set configured timezone + $table_prefix = $this->table_prefix; // Internal table names, do not translate.