PHP date_create() function

6 Jan 2025 | 1 min read

It returns new date and time.

Syntax

Note : time and timezone are the optional parameters.

Return

This function returns the DateTime object on success or FALSE on failure.

Example 1

Output:

 2018/07/25 05:00-05:00 

Example 2

Output:

 2018/07/27 

Example 3

Output:

 2018-12-20