Longhorn PHP 2023 - Call for Papers

DateTimeImmutable::createFromFormat

date_create_immutable_from_format

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

DateTimeImmutable::createFromFormat -- date_create_immutable_from_formatDevuelve un nuevo objeto DateTimeImmutable formateado según el formato especificado

Descripción

Estilo orientado a objetos

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

Estilo por procedimientos

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

Igual que DateTime::createFromFormat() excepto que trabaja con DateTimeImmutable.

add a note

User Contributed Notes 1 note

up
0
Andy Walker
6 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