Re: *Time in SYSDATE out of sync*

From: Evan J. Greene <ejg_at_sequent.com>
Date: Mon, 10 Aug 92 13:52:16 GMT
Message-ID: <1992Aug10.135216.7859_at_sequent.com>


In article <9208071553.AA07755_at_artecon> ram%artecon_at_hp-sdd.sdd.hp.com writes:
>
>Hello World
>
> The `time' part in SYSDATE is thoroughly messed up.
> Here is the output captured from the `script' command
> of SunOS 4.1.2:
>
> <stuff deleted...>
>
>SQL> select to_char(sysdate,'DD-MON-YY hh24:mm:ss') from dual ;
>
>TO_CHAR(SYSDATE,'DD-MON-YYHH24:MM:SS')
>---------------------------------------------------------------------------
>07-AUG-92 08:08:50
>
> <more stuff deleted...>

I've run into this one before. Please note:

     TO_DATE(SYSDATE, 'DD-MON-YYHH24:MM:SS')
                                     ^^
                                     This (MM) refers to a two-digit MONTH,
                                     not minutes. This should be:
     TO_DATE(SYSDATE, 'DD-MON-YYYY.HH24:MI:SS')

The reason minutes in the ram's example shows up as '08' is because this is August...

Evan Greene
Sr. Consultant, Professional Services
Sequent Computer Systems, Northeast District 25 Burlington Mall Rd.
Burlington, MA 01803 Received on Mon Aug 10 1992 - 15:52:16 CEST

Original text of this message