MySql数据库中,字段类型为datetime,转换年月日的方法 -- 方法1 使用DATE_FORMAT DATE_FORMAT(time, '%Y-%m-%d') -- 方法2 使用 CAST CAST(time AS DATE)