DateTime::getTimezone
DateTime::__set_state
DateTime
PHP Manual

# DateTime::modify

(PHP 5 >= 5.2.0)

DateTime::modify — Alters the timestamp

### 설명

public DateTime DateTime::modify ( string `$modify` )
DateTime date_modify ( DateTime `$object` , string `$modify` )

Alter the timestamp of a DateTime object by incrementing or decrementing in a format accepted by strtotime().

### 인수

`object`

  절차식 전용: date_create()가 반환하는 DateTime 객체.

`modify`

  String in a relative format accepted by strtotime().

### 반환값

Returns the modified DateTime.

### 변경점

버전 | 설명
--- | ---
5.3.0 | 반환값을 `NULL`에서 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

### 참고

- strtotime() - Parse about any English textual datetime description into a Unix timestamp

DateTime::getTimezone
DateTime::__set_state
DateTime
PHP Manual