-
dateformat question
Hi All
I have a varchar2 variable where i get the date which i need
to store in date column of a table
the varchar2 value is coming like this
dt_val := 'Wed Feb 18 07:00:00 IST 2004',
now i need to convert this into this date format
'dd/mon/yyyy hh:mi:ss am' and insert into a table
How to acheive this
Rgrds
-
To inserted such strings into date column you would use:
Code:
INSERT INTO my_table(my_date_col) VALUES
(TO_DATE('Wed Feb 18 07:00:00 IST 2004',
'Dy Mon dd hh24:mi:ss "IST" yyyy');
To display such stored date in format you want for output, you would use:
Code:
SELECT TO_CHAR(my_date_col, 'dd/mon/yyyy hh:mi:ss am')
FROM my_table;