Home  >  Article  >  Backend Development  >  php 时间戳 时区 一般是设置还是不设置?

php 时间戳 时区 一般是设置还是不设置?

WBOY
WBOYOriginal
2016-06-06 20:46:071145browse

你们做php程序时,php.ini或程序本身在设置时间戳用到的时区时都是默认不设置还是设置成亚洲上海的东八区?

回复内容:

你们做php程序时,php.ini或程序本身在设置时间戳用到的时区时都是默认不设置还是设置成亚洲上海的东八区?

时间戳总是UTC。

本地时间看需要。如果应用涉及多时区的,其实应当在php程序里把时间相关的东西封装一下,不应当依赖php的时区设置

应该是要设置的 date_default_timezone_set("Asia/Shanghai");

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