PLSQL convert date from string ‘300520231644’ to ’30/05/2023 16:44′
Hi seniors
Plesae advice or assist to convert string to char to date
from string ‘300520231644’ to date ’30/05/2023 16:44′
I tried to use this code below
SELECT to_date('3005231429', 'dd/mm/yyyy hh:mi:ss') FROM dual;
thanks in advance
>Solution :
You can do it using TO_TIMESTAMP to convert string into datetime, then TO_CHAR to convert datetime into the format needed :
SELECT to_char(TO_TIMESTAMP('3005231429', 'ddmmyyHH24mi'), 'dd/mm/yyyy HH24:mi') FROM dual;