Oracle String to Date “2013-10-15T20:12:56.24584+0100”

后端 未结 1 404
说谎
说谎 2021-01-27 21:26

I got a TIMESTAMP string, need to convert in Oracle to datetime, I try several format mask but fail, any idea?

to_timestamp(\'2013-10-15T20:12:56.24584+0100\',\'         


        
相关标签:
1条回答
  • 2021-01-27 21:58

    To get this right, you should:

    1. Use TO_TIMESTAMP_TZ function.
    2. Use FF format for fractional seconds instead of SSSSS.
    3. Enclose the literal T in quotation marks like this: "T".

    This works:

    SELECT
      TO_TIMESTAMP_TZ('2013-10-15T20:12:56.24584+0100','YYYY-MM-DD"T"HH24:MI:SS.FFTZHTZM')
    FROM dual;
    
    0 讨论(0)
提交回复
热议问题