1.将日期转换成带时间和星期的字符串并显示:
SELECT TO_CHAR(sysdate, 'YYYY-MM-DD HH24:MI:SS AM DY') FROM dual;
2.当前时间为星期几:
SELECT TO_CHAR(TO_DATE('2008-08-08', 'YYYY-MM-DD'), 'DY') FROM dual;
3.格式转换:
SELECT TO_CHAR(TO_TIMESTAMP('06-sep-17 01.53.08.549000 PM',
'dd-mon-yy HH.MI.SSxff PM','NLS_DATE_LANGUAGE = American'),
'yyyy-mm-dd HH24:MI:SS')
FROM DUAL;