PHP 8.0.26 Released!

DateTime::createFromFormat

date_create_from_format

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

DateTime::createFromFormat -- date_create_from_formatParses a time string according to a specified format

Açıklama

Nesne yönelimli kullanım

public static DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false

Returns a new DateTime object representing the date and time specified by the datetime string, which was formatted in the given format.

Like DateTimeImmutable::createFromFormat() but creates an DateTime object.

Yordamsal kullanım

date_create_from_format(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false

The procedural version takes the DateTime object as its first argument.

Bağımsız Değişkenler

See DateTimeImmutable::createFromFormat.

Dönen Değerler

Returns a new DateTime instance başarısızlık durumunda false döner.

Ayrıca Bakınız

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top