更新时间:2023-11-29 12:19:40
此查询将以所需格式输出记录时间戳中的格式化日期.
This query will output formatted date from record timestamp in required format.
SELECT `id`, `user_id`, `amount`, `status`, DATE_FORMAT(FROM_UNIXTIME(`idate`), '%Y-%m-%d %H:%i:%s') AS `date` FROM `tablename`
FROM_UNIXTIME
和 DATE_FORMAT
发挥了所有作用.
FROM_UNIXTIME
and DATE_FORMAT
do all the magic. @BillKarwin 中提到 此MySQL参考页 可能有用.
As @BillKarwin mentioned this MySQL ref page can be useful.