0
轉換日期格式:轉換日期 '爲yyyymmdd HH24:MI:SS' 以YYYY-MM-ddTHH24:MI:SS
例:轉換
'20160203 16:00:00' to '2016-02-03T16:00:00'
'20160204 15:59:59' to '2016-02-04T15:59:59'
轉換日期格式:轉換日期 '爲yyyymmdd HH24:MI:SS' 以YYYY-MM-ddTHH24:MI:SS
例:轉換
'20160203 16:00:00' to '2016-02-03T16:00:00'
'20160204 15:59:59' to '2016-02-04T15:59:59'
使用to_char
:
SELECT to_char(to_timestamp('20160204 15:59:59','yyyymmdd HH24:MI:SS'),
'yyyy-mm-dd"T"HH24:MI:SS')
-- 2016-02-04T15:59:59
或:
SELECT to_char('20160204 15:59:59'::timestamp,'yyyy-mm-dd"T"HH24:MI:SS')
-- 2016-02-04T15:59:59
你試過了什麼? – bibi