Use of oracle date functions

Source: Internet
Author: User
Oracle provides the TO_CHAR and TO_DATE functions for mutual conversion between the date type and the string type. This function has many available types, which can be divided into numeric Conversion Type (NUMBERFORMATS) and date conversion type (DATEFORMATS) list the hours of a day (01-12) HH24 hours of a day (00-23)

Oracle provides the TO_CHAR and TO_DATE functions for mutual conversion between the DATE type and the string type. This function can be divided into number formats and date formats) list the hours of a day (01-12) HH24 hours of a day (00-23)

Oracle providesTO_CHARAndTO_DATEFunction

This function has a large NUMBER of available FORMATS, which can be divided into number formats and date formats. This function lists common FORMATS of DATE conversion FORMATS.

HH12 hours per day (01-12)

HH24 hours per day (00-23)

MI minutes (00-59)

SS seconds (00-59)

MS ms (000-999)

YYYY Year (full 4-digit year (a.m)

MM Month (01-12)

DD days in January (01-31)

To_char

select to_char(createdate,'yyyy-MM-dd HH24:mi:ss') from biz_project_impl -- 2011-10-26 00:53:14 


To_date

insert into biz_project_impl(id,projectname,createdate) values(sys_guid(),'itmyhome',to_date('2012-11-24 11:18:23','yyyy-MM-dd hh24:mi:ss'));

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.