1.UNIX_TIMESTAMP() $row = strtotime(date(‘Y-m-d‘, time()));//获取当天时间戳 DELETE FROM `table` where UNIX_TIMESTAMP(addtime) < ‘$row‘//删除今天以前 2020-07-29 =》 1595952000;
2.FROM_UNIXTIME() select FROM_UNIXTIME(Unix时间戳字段) from `table` where 1=1 FROM_UNIXTIME(1595952000, ‘%Y-%m-%d‘) => 2020-07-29