Home >Backend Development >PHP Tutorial >PHP Warning: date(): It is not safe to rely on the system_PHP教程
Yesterday I encountered a PHP Warning: date(): It is not safe to rely on the system when using the date() function. This error occurred because the default date.timezone of php5 is utc, which was changed to date.timezone = PRC. That’s it. See the summary of my method below.
When running in the php program, the following warning message appears:
PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function
Mainly because the time zone is not set, the adjustment is very simple,
Open the php.ini file, find the date.timezone line, and change it to the following:
The code is as follows
|
Copy code
|
||||||||
date.timezone = Asia/Shanghai
To solve it in php program, add
|
or
http: //www.bkjia.com/PHPjc/632167.html