PHP ManualDateTime::setDatedate_date_set(PHP 5 >= 5.2.0) DateTime::setDate -- date_date_set — Sets the date DescriptionObject oriented style Procedural style Resets the current date of the DateTime object to a different date. Parameters
Return Values
Returns the DateTime object for method chaining or Changelog
ExamplesExample #1 DateTime::setDate() example Object oriented style
<?php Procedural style
<?php The above examples will output: 2001-02-03 Example #2 Values exceeding ranges are added to their parent values
<?php The above example will output: 2001-02-28 2001-03-01 2002-02-03 See Also
![]() |
PHP-Index
New Tutorial entries
|