Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

date_modify()

Example

Adjust the timestamp by adding 15 days.

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

Definition and Usage

The date_modify() function adjusts the timestamp.

Syntax

date_modify(object, modify)

Parameter Values

Parameter

Description

object

Required. Specifies a DateTime object created by date_create().

modify

Required. Specifies a date/time string.

Technical Details

 

Return Value:

 

PHP Version:

5.2+

PHP Changelog:

Returns a DateTime object on success; FALSE on failure.