1. 程式人生 > >oracle 時間與字串相互轉換

oracle 時間與字串相互轉換

to_char(date,format):時間轉字串

select to_char(sysdate,'YYYY"年"MM"月"DD"日"') 時間轉字串 from dual;


to_date(str,format):字串轉時間

select to_date('2018-02-23 15:33:21','yyyy-MM-dd HH24:mi:ss') 字串轉時間 from dual;