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
(PHP 5 >= 5.5.0, PHP 7, PHP 8)
DateTimeImmutable::createFromFormat -- date_create_immutable_from_format — Retorna um novo objeto DateTimeImmutable formatado de acordo com um formato informado
Estilo orientado a objetos
$format
, string $time
, DateTimeZone $timezone
= ?): DateTimeImmutableEstilo procedural
$format
, string $time
, DateTimeZone $timezone
= ?): DateTimeImmutableSimilar a DateTime::createFromFormat(), mas lida com DateTimeImmutable.
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