TL;DR: I have values like 2018-09-10T08:55:09.705Z in a CSV I want to import into a SQL table, what should be the type of the field in the table?

I'm trying to migrate data from mongoDB collection into MySQL, I export data into a CSV file and then I try to import them using MySQL workbench table import wizard, but for the date field createdAt with values like 2018-09-10T08:55:09.705Z it gives me this error:

- Row import failed with error: ("Incorrect datetime value: '2018-09-10T08:55:09.705Z' for column 'createdAt'

I get this same error trying SQL DATE and DATETIME types.

I'm not sure if I need to convert the date to something like Date values used in SQL or convert Date values to timestamps or there is a way to do this with the current data format.

0 Answers