1. Modify the PHP.ini file
Find the date.timezone line and remove the preceding semicolon , change to:
date.timezone = Asia/Shanghai
2. Modify the .htaccess file
There are two ways to modify the .htaccess file, As long as one of the following two statements is required
php_value date.timezone Asia/Shanghai
SetEnv TZ Asia/Shanghai
3. Modify the PHP code
Only one of the following two statements is enough
date_default_timezone_set('Asia/Shanghai');
ini_set('date.timezone','Asia/Shanghai');
For example:
<ol class="dp-xml"><li class="alt"><span><span class="tag"><</span><span> ?php </span></span></li><li><span>date_default_timezone<br />_set('Asia/Shanghai'); </span></li><li class="alt"><span class="tag">?></span><span> </span></span></li></ol>