Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP date_date_set() Function

PHP date_date_set() Function

PHP Date/Time PHP Date/Time Reference Manual

Example

Return a new DateTime object, set a new date, and then format the date:

Run Example »


Definition and Usage

The date_date_set() function sets a new date.

Syntax

date_date_set(

object,year,month,day);

Parameters Description
object Required. Specifies a DateTime object returned by date_create() DateTime object returned by
year Required. Specifies the year of the date.
month Required. Specifies the month of the date.
day Required. Specifies the day of the date.

Technical Details

Return Value: Returns a new DateTime object on success, or FALSE on failure.
PHP Version: 5.2+
Changelog: Since PHP 5.3+, the return value on success changed from NULL to DateTime.

PHP Date/Time PHP Date/Time Reference Manual