I've been trying to read the PHP documentation for my answer.
Why does PHP recognize that 04/06/2020
is in MM/DD/YYYY
format and not DD/MM/YYYY
?
Looking at the docs that is because it is simply not an accepted format. With that being the case I suppose there would never be a case where PHP would confuse this format with another?
Is there a way to amend to following so that I could tell strtotime()
the input date format (maybe completely unnecessary)?
$date = "04/06/2020";
$newDate = date("Y-m-d", strtotime($date));