- Open your CSV in Excel or Export your MySQL DB as CSV in excel.
- Select the cell containing the date you wish to convert.
- Select "custom" (or "more Number formats") from the format cells dropdown (See image below).
- In the type field type Enter “yyyy-mm-dd hh:mm:ss” (see image below)
- Select the cell, copy it and paste the format to all other cells containing dates.
- Import your CSV into MySQL.
If you like this article please add a link to it from your site, blog, facebook page, twitter or any online page. Thank you.