Merge pull request #3178 from nextcloud/default-value-logdateformat

fix default value for logdateformat
This commit is contained in:
Joas Schilling 2017-01-27 12:08:57 +01:00 committed by GitHub
commit 05884bcd7c
3 changed files with 6 additions and 4 deletions

View File

@ -716,7 +716,9 @@ $CONFIG = array(
/**
* This uses PHP.date formatting; see http://php.net/manual/en/function.date.php
*
* Defaults to ``Y-m-d\TH:i:sO`` (ISO8601)
* Defaults to ``Y-m-d\TH:i:sP`` (ISO8601 but with colon between hours and
* minutes of the timezone) - see \DateTime::ISO8601
* (https://secure.php.net/manual/en/class.datetime.php#datetime.constants.iso8601)
*/
'logdateformat' => 'F d, Y H:i:s',

View File

@ -101,7 +101,7 @@ class TimestampFormatter implements OutputFormatterInterface {
$timeZone = $timeZone !== null ? new \DateTimeZone($timeZone) : null;
$time = new \DateTime('now', $timeZone);
$timestampInfo = $time->format($this->config->getSystemValue('logdateformat', 'c'));
$timestampInfo = $time->format($this->config->getSystemValue('logdateformat', \DateTime::ISO8601));
return $timestampInfo . ' ' . $this->formatter->format($message);
}

View File

@ -75,8 +75,8 @@ class File {
$config = \OC::$server->getSystemConfig();
// default to ISO8601
$format = $config->getValue('logdateformat', 'c');
$logTimeZone = $config->getValue( "logtimezone", 'UTC' );
$format = $config->getValue('logdateformat', \DateTime::ISO8601);
$logTimeZone = $config->getValue('logtimezone', 'UTC');
try {
$timezone = new \DateTimeZone($logTimeZone);
} catch (\Exception $e) {