0

I have a date-time data that comes in this format:

2016-02-10T12:00:00.000Z

I've created a MariaDb database and a column for that date of type TIMESTAMP

However, when inserting the data into the column, I'll get an exception:

Db error: Incorrect datetime value: 2016-02-10T12:00:00.000Z for column `my_db`.`my_table`.`dt_column` 

I've tried to replace Z with '+00:00' -- to no avail, the error remained the same.

What's incorrect about it? Should I tweak the data type of my column somehow?

Or should I preprocess the value itself? How?

1 Answer 1

0

MySQL/MariaDB are rather lame when it comes to standard date syntaxes. Remove the Z. (REPLACE('...', 'Z', ''))

The T may also cause trouble. (REPLACE('...', 'T', ' '))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.