In this article, you will learn how to modify the existing timestamp value in PHP. The date_modify() function updates or changes the Timestamp value.
What is the syntax of the date_modify() function in PHP?
date_modify(object, modify)
Parameter | Details |
---|---|
object | The DateTime instance created by date_create() – Required |
modify | The new date/time string – Required |
Examples of the date_modify function
<?php
$d=date_create("2032-01-04");
date_modify($d,"+4 days");
echo date_format($d,"Y-m-d");
?>