How to convert the timestamp in Stackoverflow data dump into Oracle Timestamp format?
How do I convert this timestamp ('2008-08-03T18:06:30.913') in Stackoverflow data dump into Oracle Timestamp format? What should be included in place of the question marks in the function below?
TO_TIMESTAMP('2008-08-03T18:06:30.913','YYYY-MM-DD??HH24:MI:SS.FFF')
开发者_高级运维
I believe this should work
TO_TIMESTAMP('2008-08-03T18:06:30.913','yyyy-mm-dd"T"hh24:mi:ss"Z"')
This is in accordance to ISO 8601 format and T indicates the start of the time part.
(Can't run now to check this) Hope this helps
SQL> select to_timestamp('2008-08-03T18:06:30.913','yyyy-mm-dd"T"hh24:mi:ss.ff3')
2 from dual
3 /
TO_TIMESTAMP('2008-08-03T18:06:30.913','YYYY-MM-DD"T"HH24:MI:SS.FF3')
---------------------------------------------------------------------------
03-AUG-08 06.06.30.913000000 PM
1 row selected.
Well, you can replace the T with a space. I don't think the "T" in the string has any specific meaning. Looks like its used as a separator between date & time. You can use the replace function of oracle to remove the "T"
精彩评论