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!

TO_TIMESTAMP Truncating the date

greenyJul 28 2010 — edited Jul 28 2010
Oracle Version: 10.2.0.4

Why is to_timestamp function truncating sysdate (to 12:00 AM) ?
SQL > select value from nls_session_parameters where parameter='NLS_DATE_FORMAT';

VALUE
----------------------------------------
DD-MON-RR

SQL > select to_timestamp(Sysdate) From dual;

TO_TIMESTAMP(SYSDATE)
---------------------------------------------------------------------------
28-JUL-10 12.00.00 AM
Documentation
http://youngcow.net/doc/oracle10g/server.102/b14200/functions193.htm#sthref2021

is only talking about CHAR, VARCHAR2, NCHAR, or NVARCHAR2 as input datatypes. Is this the reason?

I just wanted to see Time quickly in SQL*Plus without having to set NLS_DATE_FORMAT every time.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 25 2010
Added on Jul 28 2010
7 comments
1,469 views