Years:
YY: two-year 16
YYY: three-year 016
YYYY: four-year 2016
Quarter
Q: Return to Quarter
Month
Mm:
MON:
MONTH:
Week
Ww:
W:
Days
Dd:
Ddd:
Dy:
Day:
Hours
HH:
HH24:
Score of
MI:
Seconds
Ss:
1. Get the current system date
-- returns the current system date SELECT from DUAL;
2. Returns the year of the system date
SELECT to_char (sysdate, ' YY ') from DUAL;
Select To_char (sysdate,'YYY') from DUAL;
SELECT To_char (sysdate,'YYYY' from DUAL;
3. Return to Quarter
SELECT To_char (sysdate,'Q' from DUAL;
4. Month of return date
Month Number:
SELECT To_char (sysdate,'MM' from DUAL;
English abbreviations for the month:
SELECT To_char (sysdate,'MON' from DUAL;
Month Full English:
SELECT To_char (sysdate,'MONTH' from DUAL;
5. Return to week
The first few weeks of the year
SELECT To_char (sysdate,'WW' from DUAL;
The week ordinal of the month
SELECT To_char (sysdate,'W' from DUAL;
6. Number of days to return a date
Day ordinal of the month
SELECT To_char (sysdate,'DD' from DUAL;
The day of the year
SELECT to_char (sysdate, ' DDD ') from DUAL;
Week of the week abbreviations
SELECT To_char (sysdate,'DY' from DUAL;
The full name of the week
SELECT To_char (Sysdate,"Day" from DUAL;
7. Return hours
12: Select to_char (sysdate,'HH' from DUAL; 24:Select to_ CHAR (sysdate,'HH24' from DUAL;
Returns the minute of the time
SELECT to_char (sysdate, ' MI ') from DUAL;
8. Return seconds
SELECT To_char (sysdate,'SS' from DUAL;
Oracle Date function