array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'datetime.createfromformat.php', 1 => 'DateTime::createFromFormat', ), 'up' => array ( 0 => 'class.datetime.php', 1 => 'DateTime', ), 'prev' => array ( 0 => 'datetime.construct.php', 1 => 'DateTime::__construct', ), 'next' => array ( 0 => 'datetime.createfromimmutable.php', 1 => 'DateTime::createFromImmutable', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/datetime/datetime/createfromformat.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.3.0, PHP 7, PHP 8)
DateTime::createFromFormat -- date_create_from_format — Parses a time string according to a specified format
Nesne yönelimli kullanım
$format
, string $datetime
, ?DateTimeZone $timezone
= null
): DateTime|falseYordamsal kullanım
$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() 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.
Returns a new DateTime instance başarısızlık durumunda false
döner.
This method throws ValueError when the
datetime
contains NULL-bytes.
Sürüm: | Açıklama |
---|---|
8.0.21, 8.1.8, 8.2.0 |
Now throws ValueError when NULL-bytes
are passed into datetime , which previously was silently
ignored.
|
For an extensive set of examples, see DateTimeImmutable::createFromFormat.