Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Oracle Newbie's Question
I am new to Oracle and confused by the difference between current_date and
sysdate (well, the SQL Reference doesnt explain their difference at all)!!
My installation is Oracle 9i R2 and when the "dbtimezone" and
"sessiontimezone" are the same, the "current_date" and "sysdate" returns
different values (test1 below)?? I have to change the "sessiontimezone" to
+8:0 in order to bring the two values the same(test2 below). I know
"current_date" should depends on my current session time zone. But what
about "sysdate"? Isn't it relative to "dbtimezone"? If not, what else is
it relative to?
=============== test 1=============
SQL> ALTER SESSION SET TIME_ZONE='-7:0';
Session altered.
SQL> select dbtimezone,sessiontimezone,current_date,sysdate from dual;
DBTIMEZONE SESSIONTIMEZONE CURRENT_DATE SYSDATE
------------ -------------------- -------------------- -------------------- -07:00 -07:00 28-JAN-2005 06:31:24 28-JAN-2005 21:31:24
SQL> select dbtimezone,sessiontimezone,current_date,sysdate from dual;
DBTIMEZONE SESSIONTIMEZONE CURRENT_DATE SYSDATE
------------ -------------------- -------------------- -------------------- -07:00 +08:00 28-JAN-2005 21:31:25 28-JAN-2005 21:31:24Received on Fri Jan 28 2005 - 07:49:35 CST
![]() |
![]() |