2013年1月10日
摘要: 转自:http://www.myexception.cn/mysql/485349.htmlMySQL时间函数的使用:查询本周、上周、本月、上个月份的数据【转】/*今天*/select * from 表名 where to_days(时间字段) = to_days(now());/*昨天*/select * from 表名 where to_days(now())-to_days(时间字段) = 1;/*近7天*/select * from 表名 where date_sub(curdate(), interval 7 day) <= date(时间字段);/*查询距离当前现在6个月的数 阅读全文
posted @ 2013-01-10 14:36 风在竹林 阅读(569) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.the8m.com/blog/article/phpa/phpwek.html注意强大的strtotime()函数和mktime()函数。 <?php echo date("Ymd",strtotime("now")), "\n"; echo date("Ymd",strtotime("-1 week Monday")), "\n"; echo date("Ymd",strtotime("-1 week Sund 阅读全文
posted @ 2013-01-10 14:33 风在竹林 阅读(232) 评论(0) 推荐(0) 编辑