The views and opinions expressed all for my own,only for study and test, not reflect the views of Any Company and its affiliates.
分类: Oracle
2009-12-14 16:14:51
to_char(sysdate,'DDD')
to_char
DY :Day of week abbreviated Mon, Tue, Fri
DAY :Day of week spelled out Monday, Tuesday, Friday
D :Day of week (1–7) 1,2,3,4,5,6,7--注意:每星期的第1天是”星期日“
DD :Day of month (1–31) 1,2,3,4…31
DDD :Day of year (1–366) 1,2,3,4…366
DDD是该天在一年内的第多少天,d是在一周内第几天,dd是一个月内的
************************************
eg:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
に接続されました。
SQL> select to_char(sysdate,'ddd') from dual;
TO_
---
348
SQL> select to_char(sysdate,'dd') from dual;
TO
--
14
SQL> select to_char(sysdate,'d') from dual;
T
-
2
SQL> select to_char(sysdate,'dddd') from dual;
TO_C
----
3482
http://hi.baidu.com/menglinxi_a/blog/item/f58d23a10c9f238346106440.html