Recently I developed a Jian 3 818 and Tree Hole reading website using Php crawler
I found an extremely weird problem when using filemtime to get the last modification time of a file
For example, I am in 2016- The file was modified at 7-3 10:00:00, but the time obtained using filemtime was bad. 2016-7-3 4:00:00
Why is there such a weird time difference of 6 hours?
= = After checking, I found out that it is a time zone problem. You can change it in the configuration file, or you can add
date_default_timezone_set("Asia/Shanghai"); //The time zone is Asia Shanghai
I forgot which place the default time zone is, anyone who is interested can check it
The above has introduced the weird 6-hour time difference problem in Php timestamps during development, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.