I have dates as text strings in the format —
16 October 2012
08 October 2012
04 October 2012
I would like to convert them into a format that is MySQL ‘date’ friendly.
I have the following implementation —
$fixed = date("Y-m-d", strtotime($date));
Which returns all dates as —
1969-12-31
Aside from my other answer, where I use PHP date functions to obtain the result, if you want to avoid them and use a much faster approach for your particular case, you could use the following custom function: