This article mainly shares with you the selection and setting of php regional time. The default time of php is European Greenwich Mean Time (Europe/Berlin), which is exactly 8 hours different.
Processing method:
1. Find the time initialization position, add, such as:
date_default_timezone_set("PRC"); echo "time:".date("Y-m-d H:i:s",time());
2. Once and for all Settings, modify the php.ini configuration file
;date.timezone=Europe/Berlin date.timezone=PRC
3. The simplest way is not to use php5.1 or above - obviously this is not advisable Method
Common settings Note:
is the People's Republic of China: PRC;
Available in mainland China: Asia/Chongqing, Asia/Shanghai, Asia/Urumqi (in order, Chongqing, Shanghai, Urumqi)
Available in Hong Kong and Taiwan: Asia/Macao, Asia/Hong_Kong, Asia/Taipei (in order, Macau, Hong Kong, Taipei)
Singapore: Asia/Singapore
The above is the detailed content of PHP regional time selection and setting. For more information, please follow other related articles on the PHP Chinese website!