Re: Dates ahead of time on PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


> Date: Sunday, May 07, 2023 15:17:00 -0400
> From: paulf@xxxxxxxxxxxxxxxxx
> On Sun, 7 May 2023 18:19:59 +0000
> Jānis Elmeris <janis.elmeris@xxxxx> wrote:
>> Was that setting unset also in your previous configuration? What
>> PHP version was the previous one?
> Not sure the previous version. But no, it wasn't set in the prior
> Debian installation. The value was commented out in the php.ini
> file.

The standard approach with most [application] config files is that if
a setting is commented out it will use the [application] default
(sometimes these are shown, sometimes not). The default for
"date.timezone" is UTC:


There used to be a warning when that value wasn't set in the .ini,
and so the default was used, but that was removed in 7.0:


It looks like prior to 5.4 a TZ "guessing algorithm" was used if the
date.timezone value wasn't set in the .ini. That was removed in 5.4
(march 2012), with UTC set as the default:


So, the default has been UTC since 5.4, with the warning (if no value
was set) in place from 5.4 to 7.0. There was actually a warning to
not trust the system's timezone setting prior to 5.4.

For ease of consistency I have always run all my servers as UTC,
regardless of where they are located.

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux