In the study of PHP timestamp, found an interesting phenomenon, is found to use strtotime () This function returned by the time stamp and other people's not the same, think it is where they wrote the wrong, and later found not so.
Because the time zone is set differently, which results in inconsistencies in the timing display, or the resulting time is not the time that we want to get. There are a number of ways to set it up, and here's a more general and simple approach.
1. Use the function ini_set (' Date.timezone ', ' Asia/shanghai ') in the program Code of PHP 5 or later, or Date_default_timezone_set (' Asia/shanghai ');
2. Modify PHP.ini, locate Data.timezone in php.ini = Remove the front of it, and then set data.timezone = "Asia/shanghai"; (If the server is not on the other machines.) Recommend the first kind);
The details can be seen here.
PHP Learning Note-4 (timestamp)