Date Conversion Functions in Oracle

Source: Internet
Author: User

To_date

To_date (Char[,fmt[nlsparams])

Char: the string to convert

FMT: Format

Nlsparams: Specifying a Date language

For example: Enquiries about employees who have entered the workforce after 2002 years:

SELECT * from emp where hiredate>to_date (' 2002-01-01 ', ' yyyy-mm-dd ');

Common date formats are shown in the following table:

Yy:2-digit year

Yyyy:4-digit year

Mm:2 Digit Month

MON: The month of simple spelling

Month: All-spell months

Dd:2 digits of the day

DY: Abbreviation of the week

Day: A full spell of the week

Hh24:24 hour time

Hh12:12 hour time

MI: Show Seconds

SS: Show Seconds

Date Conversion Functions in Oracle

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.