Subject: Re: How to display date and time from 'Select Sysdate...'
Newsgroups: comp.databases.oracle.server
References: <19970802191800.PAA13226@ladder02.news.aol.com>
Organization: InterAccess, Co. - Chicagoland's Full Service Internet Provider
Reply-To: akaplan@interaccess.com
JYF 3 (jyf3@aol.com) wrote:
: Hi, Helper :
: My target is to display system date and time at same time.
: I can do this on MSSQL Server without any problems.
: But, I can't do it on ORACLE with sentence like this:
: SELECT SYSDATE FROM DUAL;
: unexpected output
: 01-AUG-97
: expected output
: 01-AUG-97 12:35AM.
:
: If you know how to change system default datetime format, please give me a
: help.
: Thanks !
: JYF3
You will need to use the TO_CHAR function. For your needs, type:
SELECT TO_CHAR(SYSDATE, 'DD-MON-YY H:MIPM') FROM DUAL;
You will get a response like
04-AUG-97 10:19AM
-Ari Kaplan
Independent Oracle DBA Consultant
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
<-> For 100+ Oracle tips, visit my Web Page: <->
<-> <->
<-> www.arikaplan.com <->
<-> <->
<-> email: akaplan@interaccess.com <->
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
Back to Ari Kaplan's Home Page