Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Trivia question re TO_DATE(SYSDATE)

Re: Trivia question re TO_DATE(SYSDATE)

From: laleonard_SpamBanana_AT_mindspring.com <laleonard_at_mindspring.com>
Date: Sun, 10 Oct 1999 18:52:41 GMT
Message-ID: <7tqn9l$ebi$1@nnrp1.deja.com>


Ah, that makes sense... I'm guessing that the reason the time is only truncated occasionally is that sometimes NLS_DATE_FORMAT is set to the default 'DD-MON-YY', and sometimes it's set to 'DD-MON-YY HH:MM:SS' (or some format like that - I'm just guessing). In this application that's quite possible...

I think it's time I hit the manuals (this is my first serious Oracle adventure). Thanks for the explanation!

In article <7tqh58$i7g$2_at_news.seed.net.tw>,   "fumi" <fumi_at_tpts5.seed.net.tw> wrote:
>
> The parameter of TO_DATE() function is CHAR or VARCHAR2 datatype.
> Oracle implicitly converts sysdate into a VARCHAR2 string using
TO_CHAR()
> function, so the expression Oracle actually performed is
> TO_DATE(TO_CHAR(SYSDATE)).
> The default NLS_DATE_FORMAT is 'DD-MON-YY', that's why you lose
> the time part of SYSDATE.
>
> The correct usage is just SYSDATE, never use the detrimental
> TO_DATE(SYSDATE).
--



Definitive Solutions, Inc - Makers of AprCalc, the Premier Shareware Mortgage Calculator for Windows. www.DefinitiveSolutions.com

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Sun Oct 10 1999 - 13:52:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US