(PHP 5 >= 5.2.0)
DateTime::modify — Alters the timestamp
Alter the timestamp of a DateTime object by incrementing or decrementing in a format accepted by strtotime().
절차식 전용: date_create()가 반환하는 DateTime 객체.
String in a relative format accepted by strtotime().
Returns the modified DateTime.
Example #1 A date_modify() example
<?php
$date = new DateTime("2006-12-12");
$date->modify("+1 day");
echo $date->format("Y-m-d");
?>
위 예제의 출력:
2006-12-13