how to make phpMyAdmin import datetime correctly from csv?

I was just able to do this by changing the date fields to Custom format yy-mm-dd. ( FORMAT > CELLS > Custom > yy-mm-dd.

I had to save it as an XLS but was able to import it correctly directly into the table using PHPMyAdmin version 3.3.10


If you have the file in a CSV format open it up into excel.

  1. Right click the column heading that contains the dates.
  2. Select Format Cells
  3. Click the "Custom" category
  4. Paste "yyyy-mm-dd h:mm:ss" in the input box.
  5. Save the document.
  6. Import into table using phpMyAdmin

If at all possible, I'd import those values into a varchar column fake_column first, and then push them over into the real column real_columnusing STR_TO_DATE.

UPDATE tablename SET real_column = STR_TO_DATE(fake_column, '%m/%d/%Y');

Reference on how to build the format string