#查询本周记录 select * from product_process where WEEKOFYEAR(update_time)=WEEKOFYEAR(now()); #查询本月数据 select * from product_process where MONTH(update_time)=MONTH(NOW()) and year(update_time)=year(now()); #查询本季度数据 select * from product_process where QUARTER
当运行程序时,会出现如下警告: Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still ge
最近有个功能会进行数据的筛选于是便写了几个快速计算 今日,昨日,本周,上周,本月 范围的function 以便以后遇到同样的问题可以直接进行复用,代码如下: /* *获取今日的起始和结束时间 *返回值:"起始时间,结束时间" */ function ToDayStr() { var returnStr = ""; var date = new Date(); //当前时间 var year = date.getFullYear(); var month = date
使用 Smarty 的时候出现这种警告: Warning: strftime(): It is not safe to rely on the system's timezone settings. 解决办法: 设置时区 方法1: (最好的方法)在php.ini里加上找到date.timezone项,设置date.timezone = "Asia/Shanghai",重启环境就ok了. 方法2: 在需要用到这些时间函数的时候,在页面添加date_default_timezone_set