If I have a PHP string in the format of mm-dd-YYYY (for example, 10-16-2003), how do I properly convert that to a Date and then a DateTime
mm-dd-YYYY
Date
DateTime
Since no one mentioned this, here's another way:
$date = date_create_from_format("m-d-Y", "10-16-2003")->format("Y-m-d");