ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
获取今天的起始时间 ~~~ $dayStart = strtotime(date('Y-m-d')); $dayEnd = strtotime(date('Y-m-d') . ' + 1 days'); ~~~ 获取本周起始时间 ~~~ $weekStart = strtotime(date('Y-m-d') . '-' . (date('w') ? date('w') - 1 : 6) . ' days'); $weekEnd = strtotime(date('Y-m-d', $weekStart) . ' + 6 days'); ~~~ 获取本月起始时间 ~~~ $monthStart = strtotime(date('Y-m') . '-01 00:00:00'); $monthEnd = strtotime(date('Y-m', $monthStart) . '+ 1 months - 1 days'); ~~~ 获取本年起始时间 ~~~ $yearStart = strtotime(date('Y') . '-01-01 00:00:00'); $yearend = strtotime(date('Y', $yearStart) . '+ 1 years - 1 days'); ~~~