Home >Backend Development >PHP Problem >Where to change time zone in php.ini

Where to change time zone in php.ini

藏色散人
藏色散人Original
2022-01-17 10:03:182586browse

How to modify the time zone in php.ini: 1. Find the php.ini configuration file; 2. Find "data.timezone=" and remove the preceding semicolon; 3. Set "data.timezone="Asia/ Shanghai";" is enough.

Where to change time zone in php.ini

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

Where can I change the time zone in php.ini?

Modify php.ini, find data.timezone = in php.ini and remove the ";" in front of it, and then set data.timezone = "Asia/Shanghai";.

Note:

In the program code of PHP version 5 or above,

use the function ini_set('date.timezone','Asia/Shanghai');

or

date_default_timezone_set('Asia/Shanghai');

Recommended study: "PHP Video Tutorial

The above is the detailed content of Where to change time zone in php.ini. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn