DateTime::modify

PHP 5 >= 5.2.0, PHP 7, PHP 8
DateTime::modify - Alters the timestamp
Manual
Code Examples

DateTime::modify( string$modifier ): public DateTime|false

Procedural style

DateTimefalsedate_modify DateTimeobject stringmodifier

Parameters

object

Procedural style only: A DateTime object returned by date_create. The function modifies this object.

modifier

A date/time string. Valid formats are explained in Date and Time Formats.

Return Values

Returns the DateTime object for method chaining or false on failure.

Related Functions

Example of DateTime::modify

Show all examples for DateTime::modify

PHP Version:


Function DateTime::modify:

Date and Time Functions

Most used PHP functions