php获取日期信息
public function week() { echo "今天星期:" . date("w", time()); echo '<br>'; echo "上周一日期:" . date('Y-m-d H:i:s', strtotime('-2 monday', strtotime(date('Y-m-d', time())))); echo "<br>"; echo "上个周一零点时间戳:" . strtotime('-2 monday', strtotime(date('Y-m-d', time()))); echo "<br>"; echo "本周日日期:" . date('Y-m-d', (mktime(23, 59, 59, date('m'), date('d'), date('Y')) + (7 - (date('w', time()) == 0 ? 7 : date('w', time()))) * 24 * 3600)); echo "<br>"; echo "本周日23:59:59时间戳:" . (mktime(23, 59, 59, date('m'), date('d'), date('Y')) + (7 - (date('w', time()) == 0 ? 7 : date('w', time()))) * 24 * 3600); echo "<br>"; echo "上个周日日期:" . date('Y-m-d H:i:s', strtotime('-1 sunday', time()) + 24 * 3600 - 1); echo "<br>"; echo "上个周日时间戳:" . (strtotime('-1 sunday', time()) + 24 * 3600 - 1); echo "<br>"; }
╰︶﹉⋛⋋⊱⋋๑๑⋌⊰⋌⋚﹉︶╯