Re: Use of CURRENT_DATE vs SYSDATE and DST

  • From: "GovindanK" <gkatteri@xxxxxxxxxxx>
  • To: Thomas.Mercadante@xxxxxxxxxxxxxxxxx, oracle-l@xxxxxxxxxxxxx
  • Date: Thu, 22 Mar 2007 13:35:14 -0700

This one is on 10g Rel2 Solaris 64 Bit
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi
PL/SQL Release 10.2.0.2.0 - Production
CORE    10.2.0.2.0      Production
TNS for Solaris: Version 10.2.0.2.0 - Production
NLSRTL Version 10.2.0.2.0 - Production
SQL> set echo on
  1  select
  2   to_char(sysdate,'mm/dd/yyyy hh24:mi:ss')
  3  ,to_char(current_date,'mm/dd/yyyy hh24:mi:ss')
  4*  from dual
SQL> /
TO_CHAR(SYSDATE,'MM TO_CHAR(CURRENT_DAT
------------------- -------------------
03/22/2007 13:34:06 03/22/2007 13:34:07
SQL> l
  1  select
  2   to_char(sysdate,'mm/dd/yyyy hh24:mi:ss')
  3  ,to_char(current_date,'mm/dd/yyyy hh24:mi:ss')
  4*  from dual
SQL> /
TO_CHAR(SYSDATE,'MM TO_CHAR(CURRENT_DAT
------------------- -------------------
03/22/2007 13:34:24 03/22/2007 13:34:25
SQL> select to_timestamp_tz('20070311 01:59:58 US/EASTERN','YYYYMMDD HH24:MI:SS 
TZR') + TO_DSINTERVAL('0 00:00:01') from dual;
11-MAR-07 01.59.59.000000000 AM US/EASTERN
SQL> select to_timestamp_tz('20070311 01:59:58 US/EASTERN','YYYYMMDD HH24:MI:SS 
TZR') + TO_DSINTERVAL('0 00:00:02') from dual;
11-MAR-07 03.00.00.000000000 AM US/EASTERN
SQL>
SQL>
SQL>
SQL>
SQL>
SQL> SELECT CASE TO_NUMBER(TO_CHAR(TO_TIMESTAMP_TZ
  2               ('20070311 00:00:00 US/EASTERN','YYYYMMDD HH24:MI:SS TZR')
  3               + TO_DSINTERVAL('0 08:00:00'),'HH24'))
  4         WHEN 8 THEN 'The patch has not been applied'
  5         WHEN 9 THEN 'The patch has been applied correctly'
  6         ELSE        'Error' end "TZTEST (RUN FROM DB HOME)"
  7    FROM DUAL;
The patch has been applied correctly
Patch  4689959 Bugs fixed:4689959
HTH
GovindanK

Other related posts: