Dragon
主机之家测评主机之家测评  2020-03-22 15:04 主机之家测评 隐藏边栏 |   抢沙发  93 
文章评分 0 次,平均分 0.0

mysql 查询当月数据:

  select * from table where datetime > unix_timestamp(concat(date_format(now(),'%Y-%m-'),'01'));

 

  datetime:表中的时间戳字段;  

 

  unix_timestamp(concat(date_format(now(),'%Y-%m-'),'01'):当月第一天的开始时间戳。

本文为原创文章,版权归所有,欢迎分享本文,转载请保留出处!

发表评论

扫一扫二维码分享