Definition:
The Oracle PL/SQL LOCALTIMESTAMP function is used to get current date and time values in the current session, irrespective of the time zone. It returns a TIMESTAMP data type.
Notes:
- The difference between LOCALTIMESTAMP and CURRENT_TIMESTAMP is Time Zone. LOCALTIMESTAMP returns a TIMESTAMP value while CURRENT_TIMESTAMP returns a TIMESTAMP WITH TIME ZONE value.
- An optional integer argument precision may be specified to determine the fractional second precision of the time value. The default value is 6.
- If you use the LOCALTIMESTAMP with a format mask, take care that the format mask matches the value returned by the function.
- Be aware that the Time Zone of the current SQL session may be set with the ALTER_SESSION command. The results from LOCALTIMESTAMP may not be as expected if the ALTER_SESSION command has been applied without taking into account that it has been used.
Example Usage:
SELECT LOCALTIMESTAMP FROM/ DUAL;
LOCALTIMESTAMP
------------------------------
04-DEC-10 03.41.451 AM
Related Links:
Related Code Snippets: