PHP default timezone issue for Fedora + Zend Server CE

I have ZendServer CE (PHP 5.2) installed on a Fedora virtual machine, and I have the America / Chicago system time zone set. I have date.timezone = 'UTC' in my php.ini file, and when I call date_default_timezone_get () or display the date ('T') on the web page, it says “CDT”.

The php.net documentation for date_default_timezone_get () says that it follows this order when choosing the default timezone:

 - Reading the timezone set using the
   date_default_timezone_set() function
   (if any)
 - Reading the TZ environment variable
   (if non empty)
 - Reading the value of the
   date.timezone ini option (if set)
 - Querying the host operating system
   (if supported and allowed by the OS)

If I changed the time zone of the system through the "setup" GUI and rebooted the server, the date ("T") will return everything that I changed the system time zone, regardless of what php.ini says. I also don't have the TZ environment variable, and I don't use date_default_timezone_set () anywhere in my code.

Any idea what could be? I understand that I can always undo the system time zone by calling date_default_timezone_set ('UTC'), but I would rather rely on the php.ini file if possible.

Thanks for the help,

Dave

+3
source share

Source: https://habr.com/ru/post/1740373/


All Articles