/**
 * 时间格式化
 * @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;
}
//-4是美国时间,8是默认的北京时间
qgmdate('Y-m-d H:i:s', '', -4);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-01-03
  • 2021-06-15
猜你喜欢
  • 2022-12-23
  • 2021-11-21
  • 2022-03-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案