$time = time();
//自然周
$startTime = date("Y-m-d H:i:s", mktime(0, 0, 0,date("m", $time),date("d", $time) - (date("w", $time) == 0 ? 7 : date("w", $time)) + 1, date("Y", $time)));
//自然月
$startTime = date('Y-m-d H:i:s', mktime(0, 0, 0, date("m",$time), 1, date("Y",$time)));
php 获取 当前自然周 自然月 开始时间
发表于 2020-07-20 1.07k 次阅读
COMMENTS | NOTHING