Few example on date

FEW EXAMPLES ON “DATE”

SYSDATE      --GIVES DATE LIKE 12/12/2012
TO_DATE()    --HELPS TO TEXT TO DATE
SYSTIMESTAMP --PRINT DATE AND TIME

SELECT TO_CHAR(SYSTIMESTAMP,'MON-YYYY') FROM DUAL;

SELECT * FROM WWV_FLOW_MONTHS_MONTH;

SELECT SYSTIMESTAMP - INTERVAL '10' DAY FROM DUAL;

SELECT SYSDATE-10 FROM DUAL;

SELECT TO_CHAR (SYSDATE+10, 'FMDAY, DDTH MONTH YYYY') FROM DUAL;

BEGIN
DBMS_OUTPUT.PUT_LINE (
TO_CHAR (SYSDATE,
'DAY, DDTH MONTH YYYY',
'NLS_DATE_LANGUAGE=SPANISH'));
END;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s