
date_time_create_from_format_call
¶The first argument of DateTime::createFromFormat
method must start with
!
.
DateTime::createFromFormat('Y-m-d', '2022-02-11')
.
What value will be returned? ‘2022-02-11 00:00:00.0’? No, actual return
Change ‘Y-m-d’ to ‘!Y-m-d’, return value will be ‘2022-02-11 00:00:00.0’.
So, adding !
to format string will make return value more intuitive.