PHP51 above version using the DATE function is the way to handle the warning that is encountered

Source: Internet
Author: User
PHP5.1 using the date function for the above version will encounter such warning:

PHP warning:date () [function.date]: It is not safe to rely on the system ' s timezone settings. You is *required* to use the Date.timezone setting or the Date_default_timezone_set () function. In case you used any of the those methods and you is still getting this warning, your most likely misspelled The timezone identifier. We selected ' UTC ' for ' 8.0/no DST ' instead in '

This means that the time zone in PHP is not set or the function used is incorrect!

You can try to find PHP.ini (config files) in the installation file of PHP, then ctrl+f find "date.timezone", (remember the second file), the configuration file shows "; date.timez/span>"This sentence needs to be modified, to be preceded , removed, and then added to the PRCafter = , This means that the time zone feature is turned on and set to the China (PRC) time zone!

Finally, be sure to restart the server (Apache, or IIS), and then the problem is solved!!!

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The above describes the use of the PHP51 version of the date function is the way to deal with the warning, including the content, I hope to be interested in PHP tutorial friends helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.