금주 날짜 구하기 > 개발자팁

개발자팁

개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.

금주 날짜 구하기 정보

PHP 금주 날짜 구하기

본문

그누보드일경우

$day_of_week = date('w'); 

$week_mon = date('Y-m-d', strtotime(G5_TIME_YMD." -".($day_of_week - 1)."days")); // 시작일

$week_sun = date('Y-m-d', strtotime(G5_TIME_YMD." +".(6 - $day_of_week)."days")); // 종료일

 

그누보드가 아닐경우

$date = date('Y-m-d', time());

$day_of_week = date('w');

$week_mon = date('Y-m-d', strtotime($date​." -".($day_of_week - 1)."days")); // 시작일

$week_sun = date('Y-m-d', strtotime($date​." +".(6 - $day_of_week)."days")); // 종료일

추천
1
  • 복사

댓글 1개

© SIRSOFT
현재 페이지 제일 처음으로