to do a project need to compare the current time with PHP, found that the current time of PHP display and actual time there is a large difference, and then checked the data to modify-
Modify in php.ini config file Date.timezone value to set the time zone of the PHP server successfully
Other reference values:
(Asia/chongqing (Chongqing), Asia/shanghai (Shanghai), Asia/urumqi (Urumqi), Asia/macao (Macau), Asia/hong_kong (Hong Kong), Asia/taipei (Taipei))
by the way, get an instance usage that gets the current time and comparison time:
$now _time=date ("y-m-d h:i:s");//Gets the current time, the specific parameter format refers to the second reference link if (Strtotime ($end _time) <strtotime ($now _time))//comparison Time { //$end _time is another time variable value //Here indicates $end_time is earlier than the current time }
Reference:
Http://blog.sina.com.cn/s/blog_6d2675450101974k.html
Http://www.php100.com/cover/php/331.html
Apache PHP Server time timezone modification and time comparison