Oracle LOCALTIMESTAMP function
How to get current date and time values in the current session in Oracle?
The LOCALTIMESTAMP() function returns the current date and time in the session time zone in a value of datatype TIMESTAMP.
Syntax:
LOCALTIMESTAMP [ (timestamp_precision) ]
Parameters
Name | Description |
---|---|
timestamp_precision (optional) | Specifies the fractional second precision of the time value returned. |
Note: LOCALTIMESTAMP returns a TIMESTAMP value while CURRENT_TIMESTAMP returns a TIMESTAMP WITH TIME ZONE value.
Pictorial Presentation

Examples: Oracle LOCALTIMESTAMP () function
The following statements shows the difference between LOCALTIMESTAMP and CURRENT_TIMESTAMP:
SQL> ALTER SESSION SET TIME_ZONE = '-2:00';
Session altered.
SQL> SELECT CURRENT_TIMESTAMP, LOCALTIMESTAMP FROM DUAL;
Sample Output:
CURRENT_TIMESTAMP LOCALTIMESTAMP --------------------------------------------------------------------------- 01-MAY-15 05.32.24.211000 AM -02:00 01-MAY-15 05.32.24.211000 AM
SQL> ALTER SESSION SET TIME_ZONE = '-5:00';
Session altered.
SQL> SELECT CURRENT_TIMESTAMP, LOCALTIMESTAMP FROM DUAL;
Sample Output:
CURRENT_TIMESTAMP LOCALTIMESTAMP --------------------------------------------------------------------------- 01-MAY-15 02.32.46.226000 AM -05:00 01-MAY-15 02.32.46.226000 AM
Previous:
LAST_DAY
Next:
MONTHS_BETWEEN
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook