How to set the php 5.6 time zone
The main content of this article is "how to set the php 5.6 time zone", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to set the php 5.6 time zone.
The method of setting the time zone of php5.6: 1, through "date_default_timezone_set ('prc');" set the time zone to China; 2, set the time zone to "date.timezone = PRC" in PHP.INI.
This article operating environment: windows7 system, PHP5.6 version, DELL G3 computer
Php 5.6Setting time zone
One:
/ / get the default time zone echo date_default_timezone_get (); / / set the time zone to China date_default_timezone_set ('prc')
Two:
Set the time zone in PHP.INI
Date.timezone = PRC
Set the time zone in the code
1 date_default_timezone_set ('Asia/Shanghai'); / /' Asia/Shanghai' Asia / Shanghai 2 date_default_timezone_set ('Asia/Chongqing'); / / where Asia/Chongqing' is "Asia / Chongqing" 3 date_default_timezone_set (' PRC'); / / where PRC is "people's Republic of China" 4i ni_set ('date.timezone','Etc/GMT-8'); 5 ini_set (' date.timezone','PRC') 6 ini_set ('date.timezone','Asia/Shanghai'); 7 ini_set (' date.timezone','Asia/Chongqing')
Any of the above seven methods can meet our needs.
When the system is initialized, add
Ini_set ('date.timezone','Asia/Shanghai'); or date_default_timezone_set ("PRC")
The time zone difference will be solved by 8%.
It's a matter of hours.
At this point, I believe you have a deeper understanding of "how to set the php 5.6 time zone". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!