How to convert “1985-02-07T00:00:00.000Z” (ISO8601) to a date value in Oracle?

后端 未结 5 1714
情书的邮戳
情书的邮戳 2020-12-09 08:13

I tried to convert a time-stamp (\"1985-02-07T00:00:00.000Z\") to a date and I failed to succeed in my several different attempts.

Below is the query I have tried:

5条回答
  •  有刺的猬
    2020-12-09 08:42

    if u want to get the string in datetime format then try this....

    select to_char(TO_DATE('2012-06-26T00:00:00.809Z', 'YYYY-MM-DD"T"HH24:MI:SS".""ZZZZ"'),'yyyy-MM-dd hh:mm:ss PM') as EVENT_DATE from dual
    
    EVENT_DATE
    -----------------------
    2012-06-26 12:06:00 AM
    

    only for date simply use...

    select TO_DATE('2012-01-06T00:00:00.809Z', 'YYYY-MM-DD"T"HH24:MI:SS".""ZZZZ"') from dual
    

提交回复
热议问题