I'm trying to convert a VARCHAR2 variable which contains a timestamp w/ time zone into a DATE variable. I can convert the timestamp without the time zone but when I add logic for timezone I get "ORA-01821: date format not recognized". Please see code below:
DECLARE
v_string VARCHAR2(400) := '2011-05-12 19:04:41.032645 +00:00';
v_date DATE;
BEGIN
SELECT to_timestamp(v_string,'YYYY-MM-DD HH24:MI:SSxFF TZH:TZM')
INTO v_date
FROM dual;
END;