In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
In this issue, the editor will bring you about the formatted date functions in Mysql. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
DATE_FORMAT (date,format) formats the date or date and time values date based on the format string format and returns the result string.
DATE_FORMAT () to format the DATE or DATETIME value to get the desired format.
Format the date value according to the format string:
% S,% s two-digit seconds (005001,. . ., 59)
% I the score in two-digit form (00BI 01,. . ., 59)
% H double-digit hours, 24 hours (000001,. . , 23)
% h,% I two-digit hours, 12 hours (01j02,. . ., 12)
% k hours in digital form, 24 hours (0pm 1,. . , 23)
% l digital hours, 12 hours (1, 2,. . ., 12)
% T 24-hour time form (h h: mm: s s)
% r time form of 12 hours (hh:mm:ss AM or hh:mm:ss PM)
P AM or P M
% W name of every day of the week (S u nday, Monday,. . ., Saturday)
% an abbreviation of the name of each day of the week (Sun, Mon,. . ., Sat)
% d double digits represent the number of days in the month (00,01,. . , 31)
The numerical form of% e represents the number of days in the month (1, 2,. . , 31)
The% D suffix indicates the number of days in the month (1st, 2nd, 3rd,. . .)
% w represents the number of days of the week in numeric form (0 = S u nday, 1=Monday,. . ., 6=Saturday)
% j represents the number of days of the year in three digits (00002,. . , 366)
% U week (0,1,52), where Sunday is the first day of the week
% u week (0,1,52), where Monday is the first day of the week
% M month name (J a n uary, February,. . ., December)
% b abbreviated month name (J a n uary, February,. . ., December)
% m double-digit month (01,02,. . ., 12)
The month represented by the% c number (1,2,. . ., 12)
Year represented by% Y four digits
Year represented by% y double digits
% Direct value'%'
These are the formatted date functions in the Mysql that Xiaobian shared with you. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.