Friday, May 3, 2013

ORACLE SYSTIMESTAMP

ORACLE SYSTIMESTAMP 

                         systimestamp returns OS Date & time along with timezone on which oracle DB runs.


--Display Date and Time with timezone
SQL>select systimestamp from dual;

--Display only Date from systimestamp

SQL> select trunc(systimestamp) from dual;

                          OR
SQL> select to_char(systimestamp,'yyyy-mm-dd') from dual;



--Display only Time from systimestamp

SQL> select systimestamp-trunc(systimestamp) from dual;
 




No comments:

Post a Comment