There are so many places where you can modify the time settings in a set up of Linux, Apache, PHP, and MySQL. I need to set everything to UTC in my server and I wondered why not just set the system time to UTC and all services just need to use the timezone "SYSTEM" as I did for MySQL.
However, a simple PHP warning made me doubt my decision. "It is not safe to reply on the system's timezone settings"
I have to questions, one may lead to another.
You should not rely on system settings as they can be changed accidentally, as simple as that. Instead, specifying the desired timezone in php.ini
makes sure somebody gave this a thought and selected the correct timezone that is going to be used (unless overridden by ini_set
)
The best way is to specify the timezone you want in corresponding ini
and conf
files.
Moreover, if you have website now on US server and in few years you migrate to UK server, you want to copy your conf
files as well and this assures that same timezone is used at all times.