The syntax for the Oracle/PLSQL LOCALTIMESTAMP function is:
LOCALTIMESTAMP
LOCALTIMESTAMP
returns a TIMESTAMP
for the session.
LOCALTIMESTAMP function returns a TIMESTAMP value while the CURRENT_TIMESTAMP function returns a TIMESTAMP WITH TIME ZONE value.
This Oracle tutorial explains how to use the Oracle/PLSQL LOCALTIMESTAMP function.
The Oracle/PLSQL LOCALTIMESTAMP function returns the current date and time in the time zone of the current SQL session. It returns a TIMESTAMP value.
SQL> SELECT LOCALTIMESTAMP FROM dual;
-- from w w w.j a v a2s. com
LOCALTIMESTAMP
-----------------------------------------------
08-JUL-12 10.21.19.837000 AM
SQL> ALTER SESSION SET TIME_ZONE = 'EST';
Session altered.
SQL> SELECT LOCALTIMESTAMP FROM dual;
LOCALTIMESTAMP
-----------------------------------------------
08-JUL-12 01.21.19.868000 PM
SQL> ALTER SESSION SET TIME_ZONE = 'PST';
Session altered.
SQL> SELECT LOCALTIMESTAMP FROM dual;
LOCALTIMESTAMP
-----------------------------------------------
08-JUL-12 10.21.21.509000 AM
SQL>
LOCALTIMESTAMP(t)
can have parameter: t.
t is local time zone's fractional second precision. Ranges between 0 and 9. Optional; defaults to 6.
SQL> SELECT LOCALTIMESTAMP(4) FROM DUAL;
LOCALTIMESTAMP(4)
--------------------------------------------
08-JUL-12 10.22.11.2270 AM
SQL>