SELECT * FROM table_name WHERE to_days(createtime) = to_days(now());
SELECT * FROM table_name WHERE YEARWEEK(date_format(createtime,‘%Y-%m-%d‘)- INTERVAL 1 DAY) = YEARWEEK(now());
SELECT * FROM table_name WHERE date_format(createtime,‘%Y-%m‘)=date_format(now(),‘%Y-%m‘)
原文地址:https://www.cnblogs.com/mmbbflyer/p/9213843.html
时间: 2024-12-24 21:50:33