PHP document
http://php.adamharvey.name/manual/kr/function.date.php
PHP: date - Manual
Most spreadsheet programs have a rather nice little built-in function called NETWORKDAYS to calculate the number of business days (i.e. Monday-Friday, excluding holidays) between any two given dates. I couldn't find a simple way to do that in PHP, so I thr
php.adamharvey.name
다음주 월요일 날짜구하기
나는 주말에는 2주뒤 월요일 , 주중에는 다음주 월요일에 대한 날짜를 알아야했기에
아래처럼 분기처리를 했다.
$this_week_number = date('w'); //요일을 숫자로 표시 일:0, 월:1, 화:2, 수:3, 목:4, 금:5, 토:6
$this_week_start = date("Y-m-d",strtotime("-".($this_week_number - 1)." days")); // 이번주 월
if (in_array($this_week_number, [6,0])){
$dueDate = date('Y-m-d',strtotime($this_week_start.' +7 day')); // 다음주 월
} else {
$dueDate = date('Y-m-d',strtotime($this_week_start.' +14 day')); // 다다음주 월
}
오늘날짜 구하기
$today = date("Y-m-d");
한글로 요일 구하기
$week = ["일요일" , "월요일" , "화요일" , "수요일" , "목요일" , "금요일" ,"토요일"] ;
$weekday = $week[ date('w' , strtotime(date("Y-m-d")))] ;