DAYOFWEEK
Purpose
This function allows you to retrieve the day of the week from DATE and TIMESTAMP.
The output is an integer based on the session parameter NLS_FIRST_DAY_OF_WEEK, which defaults to Sunday as the first day of week.
Syntax
dayofweek::=
Usage notes
-
The function takes a single parameter which can be
DATE,TIMESTAMP, orTIMESTAMP WITH LOCAL TIME ZONE. -
The function returns the numerical value of the day of the week from
1 = Sunday, 2 = Monday, … 7 = SaturdaywhenNLS_FIRST_DAY_OF_WEEK = Sunday.
Example
SELECT DAYOFWEEK(DATE '2025-10-01');
|
DAYOFWEEK(TO_DATE('2025-10-01','YYYY-MM-DD')) |
|
4 |