diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-15 14:07:15 +0300 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-15 14:07:15 +0300 |
commit | cca3a249fd9e59caf8822060ddda5add9a8205bc (patch) | |
tree | 8671ab152635b78d7a03afb7a480678e438ce5f0 | |
parent | 0608455b011591efe4122e7193fcb831475c609b (diff) | |
parent | e2c557ab82119bda6bafe68b924e8cea3ea7299c (diff) |
Merge pull request #23240 from owncloud/backport-23222
backport of #23222
-rw-r--r-- | lib/private/log/owncloud.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/log/owncloud.php b/lib/private/log/owncloud.php index 5a48f9e1c6d..6399d7ee588 100644 --- a/lib/private/log/owncloud.php +++ b/lib/private/log/owncloud.php @@ -76,9 +76,12 @@ class OC_Log_Owncloud { } catch (Exception $e) { $timezone = new DateTimeZone('UTC'); } - $time = DateTime::createFromFormat("U.u", number_format(microtime(true), 4, ".", ""), $timezone); + $time = DateTime::createFromFormat("U.u", number_format(microtime(true), 4, ".", "")); if ($time === false) { $time = new DateTime(null, $timezone); + } else { + // apply timezone if $time is created from UNIX timestamp + $time->setTimezone($timezone); } $request = \OC::$server->getRequest(); $reqId = $request->getId(); @@ -90,8 +93,7 @@ class OC_Log_Owncloud { $url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '--'; $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : '--'; $entry = compact('reqId', 'remoteAddr', 'app', 'message', 'level', 'time', 'method', 'url'); - } - else { + } else { $entry = compact('reqId', 'remoteAddr', 'app', 'message', 'level', 'time'); } $entry = json_encode($entry); |