I’m moving data from a text file to a database. The text file has dates in the format ‘Oct 29’ and ‘Nov 1’ (Oct and Nov are the only 2 months in this file). I’d saving the date into a mysql database. How can I convert this format to a date field (assuming year 2012) without doing it manually?
Share
Without seeing your text file, assuming the year as 2012, an array including
$array as $item['datefield']and that you want to achieve the date translations in php alone:There’s little point in formatting as
yyyy-mm-dd H:m:sas you don’t have it in your datefield…