Select dtCreated, fTotal, txtOrderStatus, txtOrderRef, txtPaymentMethod
from  order1
where  txtOrderStatus != ('incomplete')
AND year(dtCreated)=2015 order by  dtCreated ASC ;


我还必须将时区更改为格林尼治标准时间+8,我该怎么办?

最佳答案

您可以这样尝试:

SELECT CONVERT_TZ(yourTime,'+00:00','+08:00');


请参考manual


  CONVERT_TZ()从以下给定的时区转换日期时间值dt
  from_tz到to_tz给定的时区,并返回结果
  值。如第10.6节“ MySQL”中所述指定时区
  服务器时区支持”。如果参数,此函数返回NULL
  是无效的。

关于mysql - 在SQL中更改UTC/GMT,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34670280/

10-09 00:37