更新时间:2023-11-29 13:12:04
您可以使用如下功能:
select FROM_UNIXTIME(UNIX_TIMESTAMP(),'%a %b %d %H:%i:%s UTC %Y');
输出将为:
'Wed Feb 05 05:36:16 UTC 2014'
在你的查询
select COUNT(DISTINCT devices) AS "Devices",
FROM_UNIXTIME(measure_tab.time,'%a %b %d %H:%i:%s UTC %Y') as d from measure_tab where
measure_tab.time >= 1375243200 and
measure_tab.time < 1375315200;
有关更多信息,您可以查看文档: http://dev.mysql.com/doc/refman/5.5/en/date- and-time-functions.html#function_from-unixtime
For more info you can check documentation: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_from-unixtime
你可以看到sql fiddle: http://sqlfiddle.com/#!2/a2581/20357
You can see sql fiddle:http://sqlfiddle.com/#!2/a2581/20357