I am trying to convert a date that I parse from a file "September 2, 1904" . How can I convert that to MySQL date format for be able to insert it in MySQL? If insert it like this i get "0000-00-00" in MySQL
I tried something like :
$date = DateTime::createFromFormat('j-M-Y', $data[11]);
//echo $date->format('Y-m-d');
Thanks in advance
strtotime.createFromFormat, you have to make the format match the date that you read from the file.j-M-Yis for2-09-1904, notSeptember 2, 1904.