X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP date_modify() Function

PHP Date/Time PHP Date/Time Reference

Example

Modify the timestamp. Add 15 days:

<?php
$date=date_create("2013-05-01");
date_modify($date,"+15 days");
echo date_format($date,"Y-m-d");
?>

Run example »

Definition and Usage

The date_modify() function modifies the timestamp.


Syntax

date_modify(object,modify);

Parameter Description
object Required. Specifies a DateTime object returned by date_create()
modify Required. Specifies a date/time string

Technical Details

Return Value: Returns a DateTime object on success. FALSE on failure
PHP Version: 5.2+
Changelog: PHP 5.3.0: Changed the return value from NULL to DateTime


PHP Date/Time PHP Date/Time Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook