php 날짜 한달후 계산
앞 단에서 그누보드 달력을 통해 $svc_bsn 을 문자열로 받을경우
20131102 에서 2013-11-02 형태로 바꾸고 한달 더하는 패턴
echo $originalDate = $svc_bsn;
echo '<br>';
echo $newDate = date("Y-m-d", strtotime($originalDate));
echo $time = strtotime($newDate);
echo $final = date("Y-m-d", strtotime("+1 month", $time));
20131102 에서 2013-11-02 형태로 바꾸고 한달 더하는 패턴
echo $originalDate = $svc_bsn;
echo '<br>';
echo $newDate = date("Y-m-d", strtotime($originalDate));
echo $time = strtotime($newDate);
echo $final = date("Y-m-d", strtotime("+1 month", $time));
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 3개
//앞 단에서 그누보드 달력을 통해 $svc_bsn 을 문자열로 받을경우
//20131102 에서 2013-11-02 형태로 바꾸고 한달 더하는 패턴
echo $originalDate = $svc_bsn;
echo '<br>';
echo $newDate = date("Y-m-d", strtotime($originalDate));
echo $time = strtotime($newDate);
echo $final = date("Y-m-d", strtotime("+1 month", $time));
[/code]