PHP time zone (TimeZone) provided three methods (rpm)

method 1:

(The best way) plus items found date.timezone in php.ini, set date.timezone = "Asia / Shanghai", restart the environment ok.

Method 2:

When we need to use these function of time, in this page date_default_timezone_set ( "PRC");

Method 3:

When setting area header plus ini_set ( 'date.timezone', 'Asia / Shanghai');

 

Summary, a method, and the method was more effective three generally have server permissions, while Tier 2 technician can control the current page, and also commonly used method of programmers.

 

 

Transfer: https://blog.csdn.net/jingtsy/article/details/80100642

Guess you like

Origin www.cnblogs.com/miaolyou/p/11163514.html