December 2003
Intermediate to advanced
448 pages
9h 5m
English
FUNCTION SYSDATE RETURN DATE;
This function returns the current date and time. It can be used in any PL/SQL expressions including initialization of variables. SYSDATE evaluates to a DATE type. If you assign SYSDATE to a string, Oracle will do an implicit conversion.
DECLARE
today DATE := SYSDATE;
BEGIN
NULL;
END;
You can set a default display format for your session with the ALTER SESSION statement.
SQL> ALTER SESSION SET
NLS_DATE_FORMAT='dd-mon-yyyy hh24:mi:ss';
The session default display now includes date and time.
SQL> select sysdate from dual; SYSDATE -------------------- 06-may-2004 12:47:07
The TRUNC function truncates a date to zero hours, minutes, and seconds. This is the earliest time possible ...
Read now
Unlock full access