字符串转日期问题
如何将字符串'2013-12-01 AM 09:39:34'转化成日期格式?
------解决方案--------------------alter session set nls_language=AMERICAN;
SELECT TO_DATE('2013-12-01 AM 09:39:34','YYYY-MM-DD PM HH:MI:SS') FROM DUAL;
------解决方案--------------------select timestamp'2013-12-01 09:39:34' from dual
这样也可以哦
------解决方案--------------------TO_CHAR
TO_DATE
这俩足够了
------解决方案--------------------
SELECT TO_DATE('2013-12-01 AM 09:39:34',
'YYYY-MM-DD AM HH:MI:SS',
'NLS_DATE_LANGUAGE = American')
FROM DUAL;
doc:http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions183.htm