Oracle: how to convert varchar2 to date

32 views Asked by At

Oracle 19.3 on Win 2019

I have a VARCHAR2 column that used to store dates as "2013-01-27T10:47:09-08:00" by the front end application, but now it's being stored as "12/09/2021 04:58:24 PM"

When I try to retrieve the data, I am getting an error:

SELECT TO_DATE(date_column,'mm/dd/yyyy hh24:mi:ss') FROM T;

ORA-01830: date format picture ends before converting entire input string

1

There are 1 answers

0
epipko On

The time component of the format model should be 'hh:mi:ss AM'