Mar
31

Convert Excel date format to MySQL date format

SQL          Trackback

If you are trying to upload CSV file into your MySQL database, and that file contains date field, you’ll have to convert it first because MySQL will not recognise Excel date format (for English(US) it is m/d/yyyy h:m).
All You have to do is:

  1. Open your xls (or csv) file in MS Excel,
  2. Highlight cells containg date,
  3. Right click and select “Format Cells…”,
  4. Select “Custom” category,
  5. Enter “yyyy-mm-dd hh:mm:ss” in Type filed

After you save file as CSV, you should have your date fields formatted for MySQL use.


top