时间:2021-07-01 10:21:17 帮助过:11人阅读
SQL> select to_char(sysdate,‘Y‘) from dual;
TO_CHAR(SYSDATE,‘Y‘)
--------------------
5
SQL> select to_char(sysdate,‘YY‘) from dual;
TO_CHAR(SYSDATE,‘YY‘)
---------------------
15
SQL> select to_char(sysdate,‘YYY‘) from dual;
TO_CHAR(SYSDATE,‘YYY‘)
----------------------
015
SQL> select to_char(sysdate,‘YYYY‘) from dual;
TO_CHAR(SYSDATE,‘YYYY‘)
-----------------------
2015
SQL> select to_char(sysdate,‘W‘) from dual; TO_CHAR(SYSDATE,‘W‘) -------------------- 4
SQL> select to_char(sysdate,‘WW YYYY-MM-DD‘) from dual; TO_CHAR(SYSDATE,‘WWYYYY-MM-DD‘ ------------------------------ 52 2015-12-27
SQL> select to_char(sysdate,‘IW YYYY-MM-DD‘) from dual; TO_CHAR(SYSDATE,‘IWYYYY-MM-DD‘ ------------------------------ 52 2015-12-27
SQL> select to_char(sysdate,‘Q YYYY-MM-DD‘) from dual; TO_CHAR(SYSDATE,‘QYYYY-MM-DD‘) ------------------------------ **4** 2015-12-27
SQL> select to_char(sysdate,‘DY YYYY-MM-DD‘) from dual; TO_CHAR(SYSDATE,‘DYYYYY-MM-DD‘ ------------------------------ 星期日 2015-12-27 SQL> alter session set nls_language=‘AMERICAN‘; Session altered SQL> select to_char(sysdate,‘dy‘) from dual; TO_CHAR(SYSDATE,‘DY‘) --------------------- sun
ORACLE——日期时间格式化参数详解 之三
标签:code 指定 sda pre can 时间 alt altered div