Return a new DateTime object, and then format the date:
The date_create() function returns a new DateTime object.
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. Tip: Look at a list of all supported timezones in PHP |
Return Value: | Returns a new DateTime object on success. FALSE on failure |
---|---|
PHP Version: | 5.2+ |
Changelog: | From PHP 5.3+; an exception is thrown if an invalid date is specified |
Return a new DateTime object (with a given timezone), and then format the date and time: