全部博文(47)
分类: Oracle
2008-03-25 15:03:06
Convert A String With Default Format To A Date | TO_DATE( |
SELECT TO_DATE('01-JAN-2004') FROM dual; | |
Convert A String With A Non-Default Format To A Date | TO_DATE( |
SELECT TO_DATE('01/01/2004', 'MM/DD/YYYY') FROM dual; | |
Convert A String With A Non-Default Format And Specify The Language | TO_DATE( |
SELECT TO_DATE('January 12, 2005, 11:03 A.M.', 'MONTH DD, YYYY, HH:MI A.M.', 'NLS_DATE_LANGUAGE = American') FROM dual; | |
Convert A String With A Non-Default Format And Specify The Language | TO_DATE( |
ALTER SESSION SET NLS_TERRITORY = 'JAPAN'; SELECT TO_DATE('January 12, 2005, 11:03 A.M.', 'Month dd, YYYY, HH:MI A.M.', 'NLS_DATE_LANGUAGE = American') FROM DUAL; ALTER SESSION SET NLS_TERRITORY = 'AMERICA'; | |
Convert A String To 24 Hour Time | TO_DATE( |
SELECT TO_CHAR(SYSDATE, 'MM/DD/YY HH24:MI:SS') FROM dual; |