Name
dayname
,
monthname
,
dayofmonth
,
dayofweek
,
dayofyear
,
quarter
,
week
,
month
,
year
,
hour
,
minute
,
second
,
timezone
— decompose a datetime to its components
Synopsis
dayname
(
|
in
dt
datetime
); |
monthname
(
|
in
dt
datetime
); |
dayofmonth
(
|
in
dt
datetime
); |
dayofweek
(
|
in
dt
datetime
); |
dayofyear
(
|
in
dt
datetime
); |
quarter
(
|
in
dt
datetime
); |
month
(
|
in
dt
datetime
); |
minute
(
|
in
dt
datetime
); |
second
(
|
in
dt
datetime
); |
timezone
(
|
in
dt
datetime
); |
Description
These functions decompose a
datetime
to its components. These can be used on
timestamps
,
datetimes
,
dates
and
times
, all being the same internal data type.
: dayname name of day
: monthname name of month
: dayofmonth day of month
: dayofweek day of week
: dayofyear day since start of year
: quarter quarter number,
: week week number
: month month number, starting at 1 for January
: year year
: hour hour
: minute minute
: second second
: timezone offset from UTC in minutes
Return Values
monthname
and
dayname
return a varchar
. The others return an
integer
.
Examples
Example 24.82. Simple example
SQL> select dayname(stringdate('2001-03-02'));
callret
VARCHAR
_______________________________________________________________________________
Friday
1 Rows. -- 3 msec.