DateTimeImmutable::createFromFormat

date_create_immutable_from_format

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

DateTimeImmutable::createFromFormat -- date_create_immutable_from_formatRetorna um novo objeto DateTimeImmutable formatado de acordo com um formato informado

Descrição

Estilo orientado a objetos

public static DateTimeImmutable::createFromFormat(string $format, string $time, DateTimeZone $timezone = ?): DateTimeImmutable

Estilo procedural

date_create_immutable_from_format(string $format, string $time, DateTimeZone $timezone = ?): DateTimeImmutable

Similar a DateTime::createFromFormat(), mas lida com DateTimeImmutable.

add a note

User Contributed Notes 1 note

up
0
Andy Walker
10 months ago
To clarify, g/G are 12/24 hour time without a leading 0, and h/H are 12/24 hour time with a leading zero, as described here:

https://www.php.net/manual/en/datetime.format.php
To Top