php5.1 the time stamp above and the actual time difference 8 hours, the solution is as follows1, the simplest way is not to use the php5.1 versionObviously this is not the preferred Method!!! 2, modify PHP.ini. Open php.ini Find Date.timezone remove the previous semicolon = after adding Asia/shanghai, restart Apache server can--The disadvantage is that if the program put on someone else's server, can not modify the php.ini, it will not be. 3, add the initialization statement of the time in the program that is: "Date_default_timezone_set ("Asia/shanghai"); "This can be arbitrarily set by the programmer, my recommendation." Time zone identifier, the value available in mainland China is: Prc,asia/chongqing, Asia/shanghai, Asia/urumqi (China, Chongqing, Shanghai, Urumqi), etc/gmt-8, asia/Harbin Taiwan available: Asia/macao, Asia/hong_kong, asia/Taipei (Macau, Hong Kong, Taipei) and Singapore: Asia/Singapore So it's time for the output to be in Beijing.
php5.1 or above version timestamp _ timestamp and date format conversion _ 8-hour difference solution