5
votes

I can convert this string to a date

select to_date('2013-10-15T17:18:28', 'YYYY-mm-DD"T"HH24:MI:SS') from dual

But how can I convert this string

'2013-10-15T17:18:28-06:00'

which includes a timezone?

1

1 Answers

4
votes

Use TO_TIMESTAMP_TZ instead:

select to_timestamp_tz('2013-10-15T17:18:28-06:00'
                      ,'YYYY-MM-DD"T"HH24:MI:SSTZH:TZM')
from dual;

15/OCT/13 05:18:28.000000000 PM -06:00