5

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?

EvilEddie
  • 1,026
  • 2
  • 12
  • 23

1 Answers1

4

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
Jeffrey Kemp
  • 59,135
  • 14
  • 106
  • 158