Apache PHP Server time timezone modification and time comparison

Source: Internet
Author: User
Tags apache php php server

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

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.