MySQL DATE_FORMAT()函数使用了哪些不同的日期格式字符?

WBOY
发布: 2023-08-22 22:21:09
转载
1401人浏览过

mysql date_format()函数使用了哪些不同的日期格式字符?

怪兽AI数字人
怪兽AI数字人

数字人短视频创作,数字人直播,实时驱动数字人

怪兽AI数字人 44
查看详情 怪兽AI数字人

Different date format characters used by MySQL DATE_FORMAT() function are as follows −

Date Format Character

Meaning

 %a

It is used to abbreviate the names of the weekdays like Sun, Mon, Tue, Wed, Thu, Fri and Sat.

%b

It is used to abbreviate the names of the month like Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov and Dec.

%c

It is used to abbreviate the number of the month like 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 and 12. There will be no leading zero.

%D

It is used to abbreviate the day of the month with an ordinal suffix like 1st, 2nd, 3rd, 4th up to 31st.

%d

It is used to abbreviate the day of the month without any suffix like 1, 2, 3, 4 up to 31.

%j

It is used to abbreviate the day of the year in three digit format 001, 002, 003, 004 up to 366.

%M

It is used to abbreviate the names of the month like January, February, March, April, May, June, July, August, September, October, November, and December.

%m

It is used to abbreviate the number of the month in two-digit formats like 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11 and 12.

%U

It is used to abbreviate the number of the weeks like 01, 02, 03, 04 up to 53. It assumes Sunday as the first week.

%u

It is also used to abbreviate the number of the weeks like 01, 02, 03, 04 up to 53. It assumes Monday as the first week.

%W

It is used to abbreviate the names of the weekdays like Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday.

%Y

It is to abbreviate year in four digits format like 1997, 2005 etc.

%y

It is to abbreviate year in two digits format like 97, 05 etc.

以上就是MySQL DATE_FORMAT()函数使用了哪些不同的日期格式字符?的详细内容,更多请关注php中文网其它相关文章!

相关标签:
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:tutorialspoint网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门推荐
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号