Converting date to MySQL date format to insert into Database

I am inserting data from a CSV file into MYSQL database. There is a date column in the CSV having date in this format d/m/Y(i.e 31/06/2016). The column datatype in MySQL database is date. I want to convert the date of csv column so that I can insert into the Database. I need this for using it in query where i will be using a date range to get the data.

You could use the explode() function to split it into separate elements, then join them back together to suit the date column in your table.

MySQL can even do some simple data modification while importing CSV using the SET clause: (about center of the page)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.