This article mainly introduces the PHPdate () function Warning: The Itisnotsafetorelyonthesystem solution is actually caused by incorrect time zone settings. This article provides two methods to solve this problem, if you need it, you can refer to the recent system email prompts and don't care about it at first. Later, I read the prompts. The following message is displayed:
The Code is as follows:
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. in case you used any of those methods and you are still gett
Ing this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing 'for 'cst/8.0/no DST 'Instead in/data0/htdocs/rows on line 542
In general, the timezone is not set. In China, the green + 8 hours are used, so you need to set it.
First
Add the following statement to the page header:
The Code is as follows:
Date_default_timezone_set ("PRC ");
This method has the disadvantage that all pages must be added.
Second
In php. ini, find the date. timezone line and change the value to PRC, for example, date. timezone = PRC. If you do not have this line, simply add it. Restart the WEB server and PHP.