Forum und email

date_modify

(PHP 5 >= 5.1.0)

date_modify — Alters the timestamp

Beschreibung

void date_modify ( DateTime $object , string $modify )
void DateTime::modify ( string $modify )

Parameter Liste

object

DateTime object.

modify

String in a relative format accepted by strtotime().

Rückgabewerte

Returns NULL on success or FALSE on failure.

Beispiele

Example#1 A date_modify() example

<?php
$date 
= new DateTime("2006-12-12");
$date->modify("+1 day");
echo 
$date->format("Y-m-d");
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

2006-12-13

Siehe auch