<?php $strTime = ‘2015-06-28 19:20:58‘; $middletime = strtotime($strTime); $week = date(‘w‘,$middletime); if ($week == 0) { $week = 7; } $monday = date(‘Y-m-d‘, strtotime(‘+‘ . 1 - $week . ‘ days‘,$middletime)) . ‘ 00:00:00‘; //星期一 $sunday = date(‘Y-m-d‘, strtotime(‘+‘ . 7 - $week . ‘ days‘,$middletime)) . ‘ 23:59:59‘; //星期日 echo $monday.‘<br/>‘; echo $sunday;
时间: 2024-10-10 00:35:34