欢迎各位兄弟 发布技术文章
这里的技术是共享的
/** * 时间格式化 * @param string $dateformat 时间格式 * @param int $timestamp 时间戳 * @param int $timeoffset 时区偏差 * @return string */function qgmdate($dateformat = 'Y-m-d H:i:s', $timestamp = '', $timeoffset = 8) { if(empty($timestamp)) { $timestamp = time(); } $result = gmdate($dateformat, $timestamp + $timeoffset * 3600); return $result;}qgmdate('Y-m-d H:i:s', '', -4);
来自 https://www.cnblogs.com/cocoqi/p/7685331.html