The LOCALTIMESTAMP function in Oracle SQL returns the current date and time (including fractional seconds) based on your session's time zone.
The most important thing to know about this function is its data type: it returns a TIMESTAMP, which does not include any time zone information (like -05:00). This is its main difference from the CURRENT_TIMESTAMP function.
What is the LOCALTIMESTAMP Function in Oracle?
The LOCALTIMESTAMP function gives you a high-precision timestamp of the current moment as it appears in your session's time zone.
Here is the key comparison:
LOCALTIMESTAMP: Returns07-NOV-25 09:30:15.123456 AM(aTIMESTAMPvalue).CURRENT_TIMESTAMP: Returns07-NOV-25 09:30:15.123456 AM -05:00(aTIMESTAMP WITH TIME ZONEvalue).
Both functions are sensitive to your session's time zone (i.e., the time will change if you change your time zone), but only CURRENT_TIMESTAMP stores the time zone offset as part of the data.
LOCALTIMESTAMP Function Syntax
The syntax for LOCALTIMESTAMP is:
LOCALTIMESTAMP [ (timestamp_precision) ]
Let's break that down:
timestamp_precision(Optional): An integer (from 0 to 9) specifying the number of digits for the fractional seconds. The default is 6.
Oracle LOCALTIMESTAMP Function Examples
Here are two practical examples of how to use LOCALTIMESTAMP.
Example 1: Getting the Current Local Timestamp with LOCALTIMESTAMP
This example shows the default output of the function. Notice that it includes fractional seconds but no time zone offset.
Query:
SELECT
LOCALTIMESTAMP
FROM DUAL;
Result: (Your result will be different, but will follow this format)
LOCALTIMESTAMP
---------------------------------------------------------------------------
07-NOV-25 07:45:15.654321 AM
Example 2: Comparing LOCALTIMESTAMP and CURRENT_TIMESTAMP
This is the best way to see the difference. We will set our session's time zone and then select both functions.
Query:
-- Set our session to a specific time zone
ALTER SESSION SET TIME_ZONE = '-05:00';
-- Now select both functions
SELECT
LOCALTIMESTAMP,
CURRENT_TIMESTAMP
FROM DUAL;
Result: (Notice both show the same time, but only CURRENT_TIMESTAMP includes the -05:00 offset.)
LOCALTIMESTAMP CURRENT_TIMESTAMP
---------------------------------- ---------------------------------
07-NOV-25 02:45:30.123456 AM 07-NOV-25 02:45:30.123456 AM -05:00