SQL:
SELECT concat(dayname(day), ', ', monthname(day), ' ', day(day), ', ', year(day)) AS day
FROM Days
结果
{"headers": ["day"], "values": [["Tuesday, April 12, 2022"], ["Monday, August 9, 2021"], ["Friday, June 26, 2020"]]}
{"headers": ["day"], "values": [["Tuesday, April 12, 2022"], ["Monday, August 9, 2021"], ["Friday, June 26, 2020"]]}
使用到的几个知识点
mysql 月份转英文 monthname()
示例:MySQL MONTHNAME() from numbers
mysql 星期几
使用dayofweek()函数,结合 case when
SELECT
CASE
DATE_FORMAT(NOW(),'%w')
WHEN 1 THEN '星期一'
WHEN 2 THEN '星期二'
WHEN 3 THEN '星期3'
WHEN 4 THEN '星期4'
WHEN 5 THEN '星期五'
WHEN 6 THEN '星期6'
WHEN 7 THEN '星期日'
END
as week
https://blog.csdn.net/qq_42583263/article/details/124887900
mysql 星期几转英文 dayname()
示例:
mysql> select dayname('20200905');
+---------------------+
| dayname('20200905') |
+---------------------+
| Saturday |
+---------------------+