Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

nls_timestamp_format and systimestamp

Syed UllahFeb 2 2012 — edited Feb 2 2012
Just wondering why systimestamp output is not influenced by the nls_timestamp_format session variable. sysdate output seems to change when nls_date_format is changed. Anyone knows why the behavior differs?
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE    11.2.0.2.0      Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production

SQL> SELECT SYSDATE FROM DUAL;

SYSDATE
---------
02-FEB-12

SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD';

Session altered.

SQL> SELECT SYSDATE FROM DUAL;

SYSDATE
----------
2012-02-02

SQL> SELECT SYSTIMESTAMP FROM DUAL;

SYSTIMESTAMP
---------------------------------------------------------------------------
02-FEB-12 02.03.13.441081 PM -06:00

SQL> ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH:MI:SS.FF';

Session altered.

SQL> SELECT SYSTIMESTAMP FROM DUAL;

SYSTIMESTAMP
---------------------------------------------------------------------------
02-FEB-12 02.03.14.785289 PM -06:00
This post has been answered by Rene Argento on Feb 2 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 1 2012
Added on Feb 2 2012
4 comments
7,819 views