반응형

echo date("Y-m-d"); //현재 일자

echo date("Y-m-d", strtotime("+ 100days")); //100일뒤 날짜 - 오늘 기준

 

디비에서 넘어온 특정 날짜 기준으로 100일 뒤 날짜 

echo date("Y-m-d", strtotime("+ 100 days", strtotime($date)));

echo date("Y-m-d", strtotime($date."+ 100 days"));

 

echo date("Y-m-d", strtotime("-1 day")); // 어제

echo date("Y-m-d", strtotime("+1 day")); //내일

echo date("Y-m-d", strtotime("+1 week")); //일주일 후 
echo  date("Y-m-d", strtotime("-1 month")); // 한달 전
echo  date("Y-m-d", strtotime("+1 month")); // 한달 후

echo date("Y-m-d", strtotime("last Sunday")); //지난주 일요일

echo date("Y-m-d", strtotime("Next Sunday")); //다음주 일요일

 

 

반응형

'PHP' 카테고리의 다른 글

Notice: Use of undefined constant 오류  (0) 2013.02.11
SWITCH 문  (0) 2010.10.26
게시판  (0) 2010.10.26
사용자 정의 함수  (0) 2010.10.26
IF 문, FOR 문,WHILE 문  (0) 2010.10.26

+ Recent posts