打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
PHP时间戳
//php获取今日开始时间戳和结束时间戳
02$beginToday=mktime(0,0,0,date('m'),date('d'),date('Y'));
03$endToday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1;
04//php获取昨日起始时间戳和结束时间戳
05$beginYesterday=mktime(0,0,0,date('m'),date('d')-1,date('Y'));
06$endYesterday=mktime(0,0,0,date('m'),date('d'),date('Y'))-1;
07//php获取上周起始时间戳和结束时间戳
08$beginLastweek=mktime(0,0,0,date('m'),date('d')-date('w')+1-7,date('Y'));
09$endLastweek=mktime(23,59,59,date('m'),date('d')-date('w')+7-7,date('Y'));
10//php获取本月起始时间戳和结束时间戳
11$beginThismonth=mktime(0,0,0,date('m'),1,date('Y'));
12$endThismonth=mktime(23,59,59,date('m'),date('t'),date('Y'));
PHP mktime() 函数用于返回一个日期的 Unix 时间戳。
//获取今天00:00
$todaystart = strtotime(date('Y-m-d'.'00:00:00',time()));
//获取今天24:00
$todayend = strtotime(date('Y-m-d'.'00:00:00',time()+3600*24));
//统计今天注册的用户
$todayuser['create_time'] = array(between,"$todaystart,$todayend");
$todaysum = $Users->where($todayuser)->count();
//获取昨天00:00
$timestart = strtotime(date('Y-m-d'.'00:00:00',time()-3600*24));
//获取今天00:00
$timeend = strtotime(date('Y-m-d'.'00:00:00',time()));
//统计昨天注册的用户
$map['create_time'] = array(between,"$timestart,$timeend");
$daycount = $Users->where($map)->count();
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
php获取本年、本月、本周时间戳和日期格式
PHP时间戳详解
时区 时间戳
PHP获取当前时间、时间戳的各种格式写法汇总[日期时间]
php获取前一天,前一个月,前一年的时间
获取一小时前的日期和时间
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服