Detailed description of date. timezone settings in php. ini, php. initimezone

Source: Internet
Author: User

Detailed description of date. timezone settings in php. ini, php. initimezone

Date. timezoneSet the default value of date. timezone in php5 to utc and change it to date. timezone = PRC to solve the eight-hour time difference problem. However, I did not find this parameter in the official php documentation for a long time.

Although we know that this parameter represents the meaning of the "People's Republic of China", this parameter is not provided in the official documentation, except for Asia/Shanghai, Asia/Hong_Kong, and other parameters, why can I set this parameter to RPC? It seems that this parameter does not exist in the official documentation. Generally, it is set to Asia/Shanghai.

Recently, xampp was used. Today, to correct the php function, the server time is obtained.

Since php5.1.0 starts, the date. timezone option is added to php. ini, Which is disabled by default. The display time is Greenwich Mean Time, which is exactly eight hours different from that in Beijing.

Methods found on the Internet:

Modify the php. ini file and search for the file; date. timezone =. Remove the semicolon before and add the time zone after "=.

For example, Asia/Chongqing (Chongqing), Asia/Shanghai (Shanghai), Asia/Urumqi (Urumqi), Asia/Macao (Macao), Asia/Hong_Kong (Hong Kong ), asia/Taipei (Taipei), PRC

Example

; Date. timezone =

Changed:

Date. timezone = Asia/Shanghai

The method is simple. However, it is useless to change the php/php. ini file under wampsever. I found out after searching on the Internet that the damn wampsever put php. ini under apache/bin. It is useful to modify the php. ini in it.

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.