Bug #78309 [Opn->Wfx]: error_log date output default timezone overrides date.timezone

From: Date: Tue, 13 Jul 2021 15:57:31 +0000
Subject: Bug #78309 [Opn->Wfx]: error_log date output default timezone overrides date.timezone
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235009@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78309&edit=1 ID: 78309 Updated by: cmb@php.net Reported by: ian dot lintner at workiva dot com Summary: error_log date output default timezone overrides date.timezone -Status: Open +Status: Wont fix Type: Bug Package: *General Issues Operating System: aws-linux, alpine PHP Version: 7.3.7 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2019-07-18 11:26:43] cmb@php.net date.timezone is PHP_INI_ALL[1], though, so it can be changed during runtime as well. [1] <https://www.php.net/manual/en/datetime.configuration.php> ------------------------------------------------------------------------ [2019-07-17 19:33:46] ian dot lintner at workiva dot com Description: ------------ error_log emitted log entry timezone appears to be using the "Default Timezone" first and before falling back to date.timezone rather than just using date.timezone as the overriding variable. So this maybe the expected behavior now, but the last error_log bugfix notes that I read the goal was to use date.timezone only, but there maybe superseding requirements that I missed or this is a feature request or documentation update. After reading tracing the PHP source it appears error_log uses the user function: php_format_date Source: https://github.com/php/php-src/blob/3c2f433b2b0a4334b4f96358660ead92abdbb2cb/main/main.c#L888 Which uses guess timezone, which follows the fallback logic of * "Default Timezone" * date.timezone * UTC (I maybe wrong) The concern is in a web application where users may specify their default Timezone (e.g. Drupal) then error_log entries can have different timezones. Personally opinion date.timezone should be the timezone for error_log as it is an ini value rather than a mutable value that may change between session, request or execution. So the error log timezone can remain consistent across multiple servers, executions. just my $.02 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78309&edit=1

« previous php.bugs (#235009) next »