如何更改此设置,以便时间为GMT,日期正确,但时间错误。
任何帮助都会感激不尽,谢谢
function format_mysql_datetime($raw) {
$format = '%Y-%m-%d %H:%M:%S';
$stringtime = strtotime($raw);
return strftime($format, $stringtime);
}
$raw = date('c');
mysql_query("INSERT INTO `Cars` VALUES ('', 'Pending', '$price', '{$fetchAccount['email']}', '$raw', '$content', '$description', '$area', '$town', '$UK', '$target', '0')") ;
答案 0 :(得分:0)
问题在于时区
使用此
date_default_timezone_set('GMT');