Skip to content
Advertisement

how to convert to_timestamp(’12-10-18 12:00:16.565736000 PM’,’DD-MM-RR HH12:MI:SSXFF AM’) into MySQL

I have one insert query in oracle —

same how can i insert in MySQL and i want output as same as oracle.

Advertisement

Answer

First try to convert str_to_date then do a date_format

so the query should be as

Sharing the fiddle here db-fiddle

p.s.

In MySQL the maximum fraction is 6, so as you have shared 9 with last 3 are zero then no issues.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement