我的网站上有一个评论区,每条评论以正常日期格式(2012 年 11 月 5 日)发布时都会显示...但我想显示“1 天前”甚至“3 小时前”正常格式......这是我到目前为止的内容:
SELECT p.poll_id, p.title, date_format(c.posted, '%D %b %y') as time, COUNT( c.poll_id ) AS count, u.username
FROM users AS u
JOIN polls AS p ON u.user_id = p.user_id
LEFT JOIN comment AS c ON p.poll_id = c.poll_id
LIMIT 5