Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to display date and time from 'Select Sysdate...'
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: <-> <-> <-> <-> http://homepage.interaccess.com/~akaplan <-> <-> <-> <-> email: akaplan_at_interaccess.com <-> <-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
JYF 3 (jyf3_at_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
Received on Mon Aug 04 1997 - 00:00:00 CDT
![]() |
![]() |