There is no need to configure the time zone for versions prior to PHP5.2.4. Here are three ways to fix the PHP time zone, for reference only, you can learn the PHP advanced Practical Tips tutorial.
1, fix php.ini this file
Find Date.timezone This line, remove the first side of the semicolon, changed to:
Date.timezone = Asia/shanghai
2. Fix. htaccess file
There are two ways to fix. htaccess files, and the following two statements require only one
Php_value Date.timezone Asia/shanghai
SETENV TZ Asia/shanghai
3. Fix PHP code
Also the following two statements only one sentence can be
Date_default_timezone_set (' Asia/shanghai ');
ini_set (' Date.timezone ', ' Asia/shanghai ');
For Example:
The above is a personal summary and in the online acquisition correction method, you can login e Mentor Network Learning Programming Language Tutorials .
This article is from the "Add Language" blog, please make sure to keep this source http://yuguotianqing.blog.51cto.com/9292883/1554447
Three ways to fix a PHP time zone