HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

date_date_set

Description

The date_date_set of Date / Time for PHP sets the date.

Syntax

date_date_set ( DateTime $object , int $year , int $month , int $day ) : DateTime

Parameters

object

A DateTime object returned by date_create(). The function modifies this object.

year

Year of the date.

month

Month of the date.

day

Day of the date.

Return

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

Examples

1

<?

$object = date_create();
$year = 2001;
$month = 2;
$day = 3;

$return = date_date_set($object, $year, $month, $day);

echo date_format($return, "Y-m-d");
2001-02-03