Home > Database > Mysql Tutorial > body text

What are the different time format characters used by the MySQL DATE_FORMAT() function?

王林
Release: 2023-09-02 13:41:02
forward
950 people have browsed it

MySQL DATE_FORMAT() 函数使用哪些不同的时间格式字符?

The different time format characters used by the MySQL DATE_FORMAT() function are as follows-

##%s is used to abbreviate seconds in two-digit format, such as 01, 02 to 59.# # %T%f
Time format characters

Meaning

%H

is used for abbreviation Hour in 24-hour format, in two-digit format, such as 00, 01, 02 to 23.

td>

%h

#It is used to abbreviate the 12-hour hour in two-digit format, such as 01, 02 to 12.

%i

# is used to abbreviate minutes in two-digit format, such as 01, 02 up to 59.

%l

# Used to abbreviate the hour in the 12-hour format, in two-digit format without zeros , such as 01, 02 to 12.

td>

%p

for morning or afternoon

%r

Used to display the 12-hour time as HH:MM:SS.

is used to display the 24-hour time as HH:MM:SS.

Used to display the microsecond range

000000..999999.

The above is the detailed content of What are the different time format characters used by the MySQL DATE_FORMAT() function?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template