I am trying to convert the date 04/03/1992 to 1992-04-03 so I can insert it into a DATE formatted SQL Table.
Below is my PHP Code. For some reason only SOMETIMES it is converted to 1970-01-01
E.g. If i try to convert 13/04/2021 this prints out as 1970-01-01
Code below -
$date = $_POST["dateOfBirth"];
$dateToTime = strtotime($date);
$DOB = date("Y-m-d", $dateToTime);
$licenseNumber = $_POST["licenseNumber"];
$licenseDate = $_POST["licenseExpiryDate"];
$licenseDateToTime = strtotime($licenseDate);
$licenseExpiryDate = date('Y-m-d', $licenseDateToTime);