jasonxu19900827

$now = gmtime();

为了获取的时间不会出现错误使用gmtime

使用time()有可能会出现晚上12点到早上8点的时间算成是前一天的

要想显示正确的时间段,

需要在php配置文件中

加上

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = UTC

分类:

技术点:

相关文章: