Home >Backend Development >PHP Problem >Where to change time zone in php.ini
How to modify the time zone in php.ini: 1. Find the php.ini configuration file; 2. Find "data.timezone=" and remove the preceding semicolon; 3. Set "data.timezone="Asia/ Shanghai";" is enough.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
Where can I change the time zone in php.ini?
Modify php.ini, find data.timezone = in php.ini and remove the ";" in front of it, and then set data.timezone = "Asia/Shanghai";.
Note:
In the program code of PHP version 5 or above,
use the function ini_set('date.timezone','Asia/Shanghai');
or
date_default_timezone_set('Asia/Shanghai');
Recommended study: "PHP Video Tutorial 》
The above is the detailed content of Where to change time zone in php.ini. For more information, please follow other related articles on the PHP Chinese website!