一、日期转字符串
1、函数:date_format(date, format)
2、实例:select date_format(now(),'%Y-%m-%d %H:%I:%S');
二、日期转时间戳
1、函数:unix_timestamp(data)
2、实例:select unix_timestamp(now());
三、字符串转日期
1、函数:str_to_date(str,format);
2、实例:select str_to_date('2018-12-07', '%Y-%m-%d %H:%I:%S');
四、日期转时间戳
1、函数:from_unixtime(time-stamp);
2、实例:select from_unixtime(1544170932);
五、日期转时间戳
1、函数:from_unixtime(time-stamp,format);
2、实例:select from_unixtime(1544170932,'%Y-%m-%d %H:%I:%S');
注:format()取值