PHP date_create() Function

PHP date_create Function


Definition 

PHP date_create() Function is inbuilt function in php.The date_create() function is used to returns a new DateTime object. It accepts two optional parameters "time" and "timezone".
Syntax : 

  date_create(time, timezone)

Parameter : 
Parameter Description
time Optional. Specifies a date/time string. NULL indicates the current time
timezone Optional. Specifies the timezone of time. Default is the current timezone.
 

Given following example Return a new DateTime object, and then format the date:

Output :  27/Dec/2021
                27-Dec-2021