我有一個mysql查詢,它具有格式爲「timestamp」的列CreationDate。例如:從MYSQL查詢格式化時間戳
2013-03-27 18:32:45
我想爲SQL查詢以它以這種方式(12小時格式秒)格式:
Friday 3/28/2013 12:52:34 PM
我想在SQL級別來處理這種而非PHP或.js文件等
查詢:
SELECT a.ID, a.CreationDate, a.Content, a.Type, u.Nickname
FROM Announcements a
INNER JOIN Accounts u ON a.FromAccountID = u.AccountID
WHERE a.Status = '1' AND u.Status = '1'
ORDER BY a.ID DESC
MySQL的['DATE_FORMAT()'](http://dev.mysql.com/doc/refman/ 5.1/en/date-and-time-functions.html#function_date-format) –