I think you want to use TO_TIMESTAMP - date cannot store your milliseconds, so it doesn't understand the FF
select to_timestamp('29-MAY-19 09.01.16.00000000 PM','dd-mon-yy hh.mi.ss.FF8 AM') from dual
Note, as GMB has pointed out, you can't get oracle to parse a.m
- you'll have to make it either a.m.
or am
. No half measures :) (hopefully its a copy pasta error)
If you're desperate to use TO_DATE, cut the milliseconds off:
select
to_date(
SUBSTR('29-MAY-19 09.01.16.00000000 PM', 1, 18) || SUBSTR('29-MAY-19 09.01.16.00000000 PM', -2, 2),
'dd-mon-yy hh.mi.ssAM'
)
from dual
If your time str is a.m.
make the second SUBSTR use , -4, 4)
- "start from right, 4 places left, then take 4 chars"
If the millis are always 00000000 you could neaten this up with a REPLACE(timeStr, '.00000000 ', '')
instead