php 날짜 연산

프로그래밍/PHP 2010. 5. 18. 13:43

date("Ymd",strtotime("-1 day"));   //1日前
date("Ymd",strtotime("-1 week"));  //1週間前
date("Ymd",strtotime("-1 month")); //1月前
date("Ymd",strtotime("-1 year"));  //1年前

date("Ymd",strtotime("1 day"));    //1日後
date("Ymd",strtotime("1 week"));   //1週間後
date("Ymd",strtotime("1 month"));  //1月後
date("Ymd",strtotime("1 year"));   //1年後結構便利です。

[출처] PHP 날짜 연산|작성자 even2mk

posted by lazymong