Home  >  Article  >  Database  >  What are the different time format characters used by the MySQL DATE_FORMAT() function?

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

王林
王林forward
2023-09-02 13:41:02951browse

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!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete