
取得下週的起始日與結束日
$d = strtotime("+1 week -1 day"); $start_week = strtotime("last sunday midnight",$d); $end_week = strtotime("next saturday",$d); $...

取得本週的起始日與結束日
$d = strtotime("today"); $start_week = strtotime("last sunday midnight",$d); $end_week = strtotime("next saturday",$d); $start = d...

快速設定找到特定天數之前的日期
方法1: [crayon-600f58df8142d595477310/] 方法2: [crayon-600f58df81433509938836/] 方法3: [crayon-600f58df81435895481757/]
使用strtotime做日期及時間加減計算
$ThisDay = '2008-01-01'; $ThisDay = strtotime($ThisDay); // 將日期轉為Unix時間戳記 $ThisDay = strtotime("+1 day",$ThisDay); // 計算$ThisDay的後...