PHP Date ("y-m-d h:i:s") warning message appears

Source: Internet
Author: User

Use:

$createtime =date ("y/m/d h:i:s", Time () +16*60*60);

$createtime =date ("y-m-d h:i:s");//Time: H = 24-hour system

The following error message appears after submitting the form:

Strict Standards: Date () [Function.date]: It is not safe to rely on the system ' s timezone settings. Please use the Date.timezone setting, the TZ environment variable or the Date_default_timezone_set () function. In case you used any of those methods and you is still getting this warning, your most likely misspelled the timezone Iden Tifier. We selected ' UTC ' for ' 8.0/no DST ' instead in C:\AppServ\www\www\phpsql\check_add.php on line one

Workaround:

Scenario 1:check_add.php Head: <?php date_default_timezone_set ("PRC"); ?> Set the default time zone to Beijing time. Resolves the current page.

Scenario 2: Set the value of Date.timezone in php.ini to PRC, set the following as: DATE.TIMEZONE=PRC, and cancel the comment of this line of code, that is, to remove the preceding semicolon.

Resolve all page usage time issues.

PHP Date ("y-m-d h:i:s") warning message appears

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.