I have many date entries in a VARCHAR field in my MySQL DB. PHP is formatting them like this:
Sun, 25 Jan 2015 18:20:04 +0000
I know how to insert dates/times into a correct MySQL DATETIME format going forward (once I correct the PHP code), but I want to run a SQL query to convert the existing DB entries. After much searching on here, I've found many people suggesting something like this:
UPDATE MyTableName SET Date2=str_to_date(Date1, '%Y-%m-%d %H:%M:%S');
However, that seems to just place "NULL" in all of the rows in my new column. Is this because MySQL cannot handle my particular PHP date format with str_to_date? If so, can anyone suggest any other ways of updating the field. I don't mind using PHP or MySQL queries to achieve this.
Many thanks.