I’m doing my first CSV import into MySQL and noticed that the date in the CSV has the format 31-Jan-2011. How can I convert this to 2011-01-31 so I can place it in the DATE datatype? The first thing which came to mind is let PHP do the conversion then insert it into a 2nd table but I’m guessing that’s…not right.
I’m doing my first CSV import into MySQL and noticed that the date in
Share
You can replace format during importing data from the CSV file, for example –
It will format the string like ’31-Jan-2011′ to a correct DATETIME data type.
More information here – LOAD DATA INFILE Syntax.