Home >Backend Development >PHP Tutorial >Share how to set time zone in php

Share how to set time zone in php

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-25 08:57:241120browse
  1. date.timezone = PRC
Copy the code

Set the time zone in the code, you can do this:

  1. date_default_timezone_set('Asia/Shanghai');
  2. date_default_timezone_set('Asia/Chongqing');
  3. date_default_timezone_set('PRC'); // PRC is the People's Republic of China
  4. ini_set('date.timezone',' Etc/GMT-8');
  5. ini_set('date.timezone','PRC');
  6. ini_set('date.timezone','Asia/Shanghai');
  7. ini_set('date.timezont','Asia/ Chongqing');
Copy code


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