I've got a date like : $date = DateTime::createFromFormat('D d/m', 'Mon 05/02'); but instead of 05 february the datetime returned is DateTime Object ( [date] => 2021-02-08 10:02:10.000000 [timezone_type] => 3 [timezone] => Europe/Brussels )
Answer Corrected with the Y input and got the right result, php was using 2021 when i was constructing 2022 year
Fri 05/02, this gets you 2021-02-05 as to be expected.Mon 05/02stored somewhere, but you need to create the date for05/02of the current year - then remove theDfrom your pattern, and cut the day name off the value.DateTime::createFromFormat('d/m', explode(' ', 'Mon 05/02')[1])