from_unixtime(unix_timestamp, format) 把时间戳转化为指定的格式 as: select from_unixtime(addTime, '%Y-%m-%d %h:%i:%s') as datetime from table1 unix_timestamp([datetime]) 把日期时间转化为时间戳 as: select from_unixtime([addDay]) as unixtime from table1 case(value as type) co…
MySQL DATE_FORMAT() 函数注:当前年份是2018-7-19 SELECT DATE_FORMAT(NOW(),'%Y') YEAR 输出结果:2018 SELECT DATE_FORMAT(NOW(),'%y') YEAR 输出结果:18 SELECT DATE_FORMAT(NOW(),'%m') …