时间:2021-07-01 10:21:17 帮助过:10人阅读
SQL> select to_char(sysdate,‘DDD YYYY-MM-DD PM hh24:mi:ss ‘) from dual;
TO_CHAR(SYSDATE,‘DDDYYYY-MM-DD‘)
------------------------------
361 2015-12-27 下午 18:13:15
select to_char(sysdate,‘Day YYYY-MM-DD PM hh24:mi:ss ‘) from dual;
TO_CHAR(SYSDATE,‘DAYYYYY-MM-DD‘)
-----------------------------------
星期日 2015-12-27 下午 18:46:23
SQL> select to_char(sysdate,‘MON YYYY-MM-DD PM hh24:mi:ss ‘) from dual;
TO_CHAR(SYSDATE,‘MONYYYY-MM-DD‘)
----------------------------------
12月 2015-12-27 下午 18:47:33
SQL> select to_char(sysdate,‘MONTH YYYY-MM-DD PM hh24:mi:ss ‘) from dual;
TO_CHAR(SYSDATE,‘MONTHYYYY-MM-‘)
--------------------------------
12月 2015-12-27 下午 18:48:44
SQL> select to_char(sysdate,‘MM‘) from dual;
TO_CHAR(SYSDATE,‘MM‘)
---------------------
12
SQL> select to_char(sysdate,‘HH‘) from dual;
TO_CHAR(SYSDATE,‘HH‘)
---------------------
06
select to_char(sysdate,‘HH12‘) from dual;
TO_CHAR(SYSDATE,‘HH12‘)
-----------------------
06
SQL> select to_char(sysdate,‘HH24‘) from dual;
TO_CHAR(SYSDATE,‘HH24‘)
-----------------------
18
SQL> select to_char(sysdate,‘MI‘) from dual;
TO_CHAR(SYSDATE,‘MI‘)
---------------------
59
SQL> select to_char(sysdate,‘SS‘) from dual;
TO_CHAR(SYSDATE,‘SS‘)
---------------------
13
SQL> select to_char(SYSTIMESTAMP,‘FF9‘) from dual;
TO_CHAR(SYSTIMESTAMP,‘FF9‘)
---------------------------
487000000
SQL> select to_char(SYSTIMESTAMP,‘FF4‘) from dual;
TO_CHAR(SYSTIMESTAMP,‘FF4‘)
---------------------------
4740
SQL> select to_char(SYSTIMESTAMP,‘FF6‘) from dual;
TO_CHAR(SYSTIMESTAMP,‘FF6‘)
---------------------------
032000
ORACLE——日期时间格式化参数详解 之二
标签:逗号 char log 日期时间 date sda 范围 名称 --