(date, format) 函数,MySQL日期格式化函数date_format()
unix_timestamp() 函数
str_to_date(str, format) 函数
from_unixtime...(unix_timestamp, format) 函数,MySQL时间戳格式化函数from_unixtime
时间转字符串
select date_format(now(), '%Y-%m-%d'); ...值含义秒%S、%s两位数字形式的秒( 00,01, ..., 59)分%I、%i两位数字形式的分( 00,01, ..., 59)小时 %H24小时制,两位数形式小时(00,01, ...,23)%h12...小时制,两位数形式小时(00,01, ...,12)%k24小时制,数形式小时(0,1, ...,23)%l12小时制,数形式小时(0,1, ...,12)%T24小时制,时间形式(HH:mm:ss)%...r 12小时制,时间形式(hh:mm:ss AM 或 PM)%p AM上午或PM下午 周 %W一周中每一天的名称(Sunday,Monday, ...