|
DateTime::modifydate_modifyAlters the timestamp DescriptionObject oriented style
public DateTime DateTime::modify
( string
$modify
)Procedural style
DateTime date_modify
( DateTime
$object
, string $modify
)Alter the timestamp of a DateTime object by incrementing or decrementing in a format accepted by strtotime. Parameters
Return Values
Returns the DateTime object for method chaining or Changelog
ExamplesExample #1 DateTime::modify example Object oriented style
<?php Procedural style
<?php The above examples will output: 2006-12-13 Example #2 Beware when adding or subtracting months
<?php The above example will output: 2001-01-31 2001-03-03 See Also
|