|
DateTime::setDatedate_date_setSets the date DescriptionObject oriented style
public DateTime DateTime::setDate
( int
$year
, int $month
, int $day
)Procedural style
DateTime date_date_set
( DateTime
$object
, int $year
, int $month
, int $day
)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
|