Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set the php 5.6 time zone

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report