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'):当月第一天的开始时间戳。
零五科技,分享IT知识,国内顶级IT知识门户网站。
Copyright (C) www.02405.com, All Rights Reserved.
零五科技 版权所有 辽ICP备13002105号-1