About this question
I'm receiving the date in 'Sun Jun 20 00:40:27 IST 2021' format. Which I need to insert to my MySQL database in datetime(6) format.
I used
STR_TO_DATE('Sun Jun 20 00:40:27 IST 2021','%d/%m/%Y %T')and received
Incorrect datetime value: 'Sun Jun 20 00:40:27 IST 2021' for function str_to_date error.I also tried
date_format('Sun Jun 20 00:40:27 IST 2021','%d/%m/%Y %T')and received
Incorrect datetime value: 'Sun Jun 20 00:40:27 IST 2021Can anyone guide me to fix it?
PS: I'm using a prepared statement, executeBatch() to insert data to the table.