Comments - Datetime format YYYYMMDD hh:mm:ss.fff
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
As far as I know, INSERT expects dates/times in standard ISO-8601 format (https://en.wikipedia.org/wiki/ISO_8601). That requires a dash between the parts of the date.
So you will have to convert '20210315' to '2021-03-15' before feeding it into INSERT.
I'm not as familiar with the time format, which may require massaging, as well.
The earlier comment is correct, and you need to convert the data to the standard format. If you must do this on the MariaDB side, something like
should work assuming the dates you are inserting are always in that same format.
Also note, TABLE is a reserved word, so you probably don't want to be using it as the table name.
thank you for your answer, but what I need is not to change the insert query that I am using, if there is an option in the Database that allows us to change the time format it will be easier.
Can't do that, as you've been told several times.
It's time for "Plan B."
People who ask for advice shouldn't have a foregone conclusion that they're stuck on.
No, since what you are attempting to insert is not a valid datetime, the only other alternative would be to make the field a string.