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

Home -> Community -> Usenet -> c.d.o.misc -> Re: VBQ (very basic question) date

Re: VBQ (very basic question) date

From: Kenneth C Stahl <kstahl_at_lucent.com>
Date: Thu, 24 Jun 1999 13:54:46 -0400
Message-ID: <377270E6.B521BE84@lucent.com>


The default date format has nothing to do with the way a date is stored, it only effects the way it is extracted.

Thus, if you perform the following and the default date format is use: select sysdate from dual;

you'll get 24-jun-98 or something like that. If you want to see the date in the format you specified, enter:

select to_char(sysdate,'DD MON YYYY HH24 MI SS') from dual;

If you are working in sqlplus and want all of your dates to come out this way, then before you enter any queries, enter:

alter session set nls_date_format = 'DD MON YYYY HH24 MI SS';

and then if you enter the original query I gave above it will be displayed with the new default format.

If you want this to be the default for the database then you can set the nls date format in your init file. But before you do that you will want to find out if that is ok with all users of the database because you could make a lot of programs fail if they are expecting the normal default format. I'd never recommend this unless there are compelling reasons for doing so that just go beyone personal preference.

Ken

bernd1615_at_my-deja.com wrote:

> Dear Participants ,
>
> I have some trouble setting the date format:
>
> create table some_table
> ( ...
> dat date,
> ... )
>
> I don`t want to take the default date format but something like :
>
> ...
> dat date (DD MON YYYY HH24 MI SS) ,
> ...
> Does someone of you know the correct syntax for that ?
>
> Your insight knowledge will be greatly appreciated !
>
> Markus Banach
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Received on Thu Jun 24 1999 - 12:54:46 CDT

Original text of this message

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