PHP Warning:strtotime () Error resolution _php Tutorial

Source: Internet
Author: User
Strtotime () function is a php date function, the problem is that we php.ini in the Date.timezone is not set, as long as the time zone can be configured to resolve.


Php5.1.0 started, php.ini added date.timezone this option, which is turned off by default. The time shown is Greenwich Mean Time, which is 8 hours from Beijing.

Solutions are:

Modify the php.ini file to find the;d Ate.timezone =, remove the preceding semicolon and add the time zone after "=".

Like what:

Asia/chongqing (Chongqing),
Asia/shanghai (Shanghai),
Asia/urumqi (Urumqi),
Asia/macao (Macau),
Asia/hong_kong (Hong Kong),
Asia/taipei (Taipei),
PRC China

Such as

The code is as follows Copy Code

Date.timezone = PRC

It is also possible to add the program page in PHP to the front

The code is as follows Copy Code

Date_default_timezone_set (' asia/chongqing ');
echo Date (' y-m-d h:i:s ');
?>

Related Recommended Reading

Multiple solutions for 8 hours of time difference in PHP

Http://www.bKjia.c0m/phper/31/42398.htm

PHP Date Difference 8 hours Solution

Http://www.bKjia.c0m/phper/31/37224.htm

PHP gets server time (solves 8-hour gap problem)

Http://www.bKjia.c0m/phper/31/34041.htm

http://www.bkjia.com/PHPjc/633215.html www.bkjia.com true http://www.bkjia.com/PHPjc/633215.html techarticle Strtotime () function is a php date function, the problem is that we php.ini in the Date.timezone is not set, as long as the time zone can be configured to resolve. php5.1.0 start, php.ini riga ...

  • 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.