Programming/PHP
주말 제외 날짜 계산(excluding weekend)
$sdate = strtotime("2020-12-16"); $edate = strtotime("2020-12-21"); $days = []; while(date("Y-m-d", $sdate) < date("Y-m-d", $edate)) { if(date("N", $sdate) < 6) $days[] = date("Y-m-d", $sdate); $sdate = strtotime("+1 day", $sdate); } print_r($days);
2020. 12. 21. 12:15