About the weird 6 time difference in PHP timestamps in development

Source: Internet
Author: User
Recently used PHP crawler to develop a sword 3 of 818 and the tree hole of the reading site

A very strange question was found when using Filemtime to get the last modification time of the file.

For example, I was a 2016-7-3 10:00:00 modified file, but with Filemtime to get to the bad times 2016-7-3 4:00:00

Why is there a 6-hour time lag that is so weird?

= = Check to find a time zone problem, you can go to the configuration file changes, you can also add a PHP file at the beginning of the

Date_default_timezone_set ("Asia/shanghai"); Time zone for Shanghai, Asia

The default time zone is where the forgotten, interested members can go to check

The above describes the PHP timestamp in the development of the strange 6 small time difference, including the content, I hope the PHP tutorial interested in a friend to help.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.