📅  最后修改于: 2020-11-20 06:41:18             🧑  作者: Mango
time_format()是MySQL日期/时间函数。它用于以指定的给定format_mask格式化时间。
select time_format(time, format_mask)
时间:要格式化的时间
Format_mask:要按时应用的格式,下面是选项列表
VALUE | DESCRIPTION |
---|---|
%f | Microseconds (000000 to 999999) %f is available starting in MySQL 4.1.1 |
%H | Hour (00 to 23 generally, but can be higher) |
%h | Hour (00 to 12) |
%I | Hour (00 to 12) |
%i | Minutes (00 to 59) |
%p | AM or PM |
%r | Time in 12 hour AM or PM format (hh:mm:ss AM/PM) |
%S | Seconds (00 to 59) |
%s | Seconds (00 to 59) |
%T | Time in 24 hour format (hh:mm:ss) |