Trunc and round-Date Format models in Oracle

Source: Internet
Author: User
Tags rounds
Round and trunc date functions

Table 7-13 lists the format models you can use withRoundAndTruncDate functions and the units to which they round and truncate dates. The default model, 'dd', returns the date rounded or truncated to the day with a time of midnight.

Table 7-13 Date Format models for the round and trunc date functions

Format Model Rounding or truncating Unit
Ccscc
One greater than the first two digits of a four-digit year
Syyyyyyyyyearsyearyyyyyy
Year (rounds up on July 1)
Iyyyiyiyi
ISO year
Q
Quarter (rounds up on the sixteenth day of the second month of the quarter)
Monthmonmmrm
Month (rounds up on the sixteenth day)
WW
Same day of the week as the first day of the year
IW
Same day of the week as the first day of the ISO year
W
Same day of the week as the first day of the month
Dddddj
Day
Daydyd
Starting day of the week
Hhhh12hh24
Hour
Mi
Minute

The starting day of the week used by the format models day, Dy, and D is specified implicitly by the initialization parameterNls_territory.

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.