oracle--one of the time-of-day formatting parameters

Source: Internet
Author: User

2. Date formatting parameters in detail 2.1-/,.;: Specifies the return string delimiter
Sql> SelectTo_char (Sysdate,'yyyy.mm.dd') fromdual; To_char (Sysdate,'YYYY. Mm.dd')-----------------------------2015.12. -SQL> SelectTo_char (Sysdate,'YYYY+MM=DD') fromdual; To_char (Sysdate,'YYYY+MM=DD')----------------------------- -+ A= -SQL> SelectTo_char (Sysdate,'YYYY-MM-DD') fromdual; To_char (Sysdate,'YYYY-MM-DD')----------------------------- -- A- -
2.2 AD/A.D. CE logo
Sql> SelectTo_char (Sysdate,'AD Yyyy-mm-dd') fromdual; To_char (Sysdate,'ADYYYY-MM-DD'------------------------------Ad -- A- -SQL> SelectTo_char (Sysdate,'A.D. Yyyy-mm-dd') fromdual; To_char (Sysdate,'a.d.yyyy-mm-d------------------------------A.D. 2015-12-28
2.3 BC/B.C. CE logo
SQL>Select to_char (sysdate,'B.C. Yyyy-mm-dd' from Dual To_char (sysdate,'b.c.yyyy-mm-d------------------------------A.D. 2015-12-28sql> Select To_char (Sysdate, ' BC yyyy-mm-dd') from dual; To_char (sysdate,'bcyyyy-MM-DD'------------------------- -----* * * 2015-12-28
2.4 AM/A.M. Meridian identification
SQL>Select to_char (sysdate,'yyyy-mm-dd AM hh24:mi:ss'from  Dual; To_char (sysdate,'yyyy-mm-ddamh------------------------------2015-12-27 * * pm * * 17:52:58
2.5 pm/p.m. Meridian identification
SQL>Select to_char (sysdate,'yyyy-mm-dd PM hh24:mi:ss'from  Dual; To_char (sysdate,'yyyy-mm-ddpmh------------------------------2015-12-27 * * pm * * 17:54:29
2.6 CC/SCC Century logo, s prefix specified in case of BC Display, will be added (-) before the display
提示:如果年份中最后两位数字在01到99(含)之间,则返回值等于年份前两位+1如果年份中最后两位数字是00,则返回值与年份前两位相同

SQL>Select to_char (sysdate," from dual; To_char (sysdate,'ccyyyy-mm-ddp------------------------------**21** 2015-12-27 pm 17:57:10
2.7 D date of week (range: 1-7)
SQL>Select to_char (sysdate," from dual; To_char (sysdate,'dyyyy-mm-ddpm------------------------------1 2015-12-27 pm 18:09:43




oracle--one of the time-of-day formatting parameters

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.