Definition
The date_date_set() function sets a new date.
Syntax
date_date_set(object, year, month, day)
Parameters
Parameter | Description |
---|---|
object |
Required. Specifies a DateTime object returned by date_create() . |
year |
Required. Specifies the year of the date. |
month |
Required. Specifies the month of the date. |
day |
Required. Specifies the day of the date. |
Example
<?php
$date = date_create();
date_date_set($date, 2040, 12, 25);
echo date_format($date, "Y/m/d");