MariaDB [supplier monitoring]> select time as "h:mm:a" from delivers;
我只是想问我如何将这个时间转换到“h:mm:a”,就像这样 1:00pm
最佳答案
如果您有一列 time
数据类型,则可以使用 time_format()
:
select time_format(mycol, '%h:%i %p') from delivers;
如果列的数据类型为datetime
,那么您需要date_format()
:
select date_format(mycol, '%h:%i %p') from delivers;
关于mysql - 在mysql中将时间转换为 "h:mm:a",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59003142/