Get the App
SLTechnology News&Howtos  ›  Development  › 

How to set the php 5.6 time zone

Shulou Source: shulou.com Published: 2022-06-03 05:19:32 11月11日 Update

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!

Tags: Time zone method center content system China Asia learning practical deeper people code interest practicality practical hour easy to operate more friends environment Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei macOS NVidia MySQL Redmi