: This article mainly introduces how to handle warnings when using the Date function in PHP51 or later versions. if you are interested in the PHP Tutorial, refer to it. If you use the Date function in PHP5.1 or later versions, you will encounter the following Warning:
"PHP Warning: date () [function. 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 getting this warning, you most likely misspelled the timezone identifier. we selected 'utc' for '8. 0/no DST 'Instead in"
This indicates that the time zone in PHP is not set or the function used is incorrect!
You can try to find PHP in the php installation file. ini (the file after configuration), and then Ctrl + F to find "date. timezone ", (the second file should be remembered), and the configuration file displays"; date. timez/span> "This statement needs to be modified. remove the previous one, and add PRC to the end of =. this means to enable the time zone function and set it to China (PRC) time zone!
Finally, you must restart the server (Apache, or IIS) and solve the problem !!!
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.
The above section describes how to handle the warning when using the Date function in PHP51 or later versions, including some content. I hope my friends who are interested in the PHP Tutorial can help me.