|
DateTime::createFromFormatdate_create_from_formatParses a time string according to a specified format DescriptionObject-oriented style
public static DateTimefalse DateTime::createFromFormat(string
$format, string $datetime, DateTimeZonenull $timezone = null)Procedural style DateTimefalse date_create_from_format(string
$format, string $datetime, DateTimeZonenull $timezone = null)
Returns a new DateTime object representing the date and time specified by the
Like DateTimeImmutable::createFromFormat and date_create_immutable_from_format, respectively, but creates a DateTime object. This method, including parameters, examples, and considerations are documented on the DateTimeImmutable::createFromFormat page. ParametersReturn Values
Returns a new DateTime instance or Errors/Exceptions
This method throws ValueError when the
Changelog
ExamplesFor an extensive set of examples, see DateTimeImmutable::createFromFormat. See Also
|