![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
时间
石小菜
三天打鱼两天晒网
展开
-
PHP获取当天、本周、本月起始时间戳
//当天 $start_time = strtotime(date('Y-m-d').'00:00:00'); $end_time = strtotime(date('Y-m-d').'23:59:59'); //本周 $nowDate = date("Y-m-d"); $week = date('w',strtotime($nowDate));//周日为0 $start_time = strtotime("$nowDate -".($week ? $week - 1 : 6).原创 2021-09-03 09:39:45 · 451 阅读 · 0 评论 -
PHP将时间按分钟、小时、天等分
//@params type 1 = minute; 2 = hour; 3 = day; public function average_time($type = 3){ $formatStyle = [ 1 => 'Y-m-d H:i:s', 2 => 'Y-m-d H:i', 3 => 'Y-m-d', ]; //test $...原创 2021-07-29 11:03:05 · 525 阅读 · 0 评论