ORACLE to_char,to_date Function Format description

Source: Internet
Author: User

    1. Year, English full name of vintage
    2. YYYY: Year four-bit representation
    3. Yyy,yy,y: The last three, two, or a bit of the year, the default is the current century
    4. Month Number of mm:01~12
    5. Month: Nine characters in months, and the right is filled with a space
    6. MON: three-character month abbreviation
    7. W: The week ordinal of the month
    8. WW: The first week of the year
    9. D: The day of the week
    10. DD: The day ordinal of the month
    11. DDD: The first day of the year
    12. Day: When in a few days to write, the right with a space to complete
    13. DY: When in a few days abbreviation
    14. Q: Quarterly
    15. Hh,hh12: The first hour of the day, 12 binary notation
    16. HH24: The first hour of the day, the value is 00~23
    17. MI: Minutes in an hour
    18. SS: seconds in one minute
    19. SSSS: The number of seconds to go from midnight
Example: 1, ask the day of the week: Select To_char (to_date (' 2002-08-26 ', ' YYYY-MM-DD ') from dual; return Monday. Select To_char (to_date (' 2002-08-26 ', ' yyyy-mm-dd '), ' Day ', ' nls_date_language = American ') from dual; return to Monday. 2, set the date language: ALTER SESSION set nls_date_language= ' AMERICAN '; 3, the number of days to find two days: Select Floor (sysdate-to_date (' 20020405 ', ' YYYYMMDD ')) from dual; return 4080.

ORACLE to_char,to_date Function Format description

Related Article

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.