不同系统之间时间转换(NLS_DATE_LANGUAGE )
英文:
SELECT TO_CHAR(sysdate,
'MM/DD/YYYY HH:MI AM',
'NLS_DATE_LANGUAGE = American')
FROM DUAL
日文:
SELECT TO_CHAR(sysdate,
'MM/DD/YYYY HH:MI AM',
'NLS_DATE_LANGUAGE = Japanese')
FROM DUAL
中文:(特别注意NLS_DATE_LANGUAGE多个单引号)
SELECT TO_CHAR(sysdate,
'MM/DD/YYYY HH:MI AM',
'NLS_DATE_LANGUAGE = ''SIMPLIFIED CHINESE''')
FROM DUAL
总结如下:
SELECT TO_CHAR(SYSDATE,'DY') FROM DUAL;
SELECT TO_CHAR(SYSDATE,'DAY','NLS_DATE_LANGUAGE = ''SIMPLIFIED CHINESE''') from dual;
SELECT TO_CHAR(SYSDATE,'DAY','NLS_DATE_LANGUAGE = American') from dual;
SELECT TO_CHAR(SYSDATE,'DAY','NLS_DATE_LANGUAGE = Korean') from dual;
结果如下:
MON
星期一
MONDAY
월요일