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: Date Format

Re: Date Format

From: <webbde_at_post.queensu.ca>
Date: Tue, 31 Aug 1999 19:45:15 GMT
Message-ID: <7qhbc8$54p$1@nnrp1.deja.com>


Add the entery NLS_DATE_FORMAT='DD-MON-YYYY' to the INITsid.ora file. As well, if the client is Win95/98/NT you must add the entry to the registry.
Remember that YYYY allows the user to enter 2 or 4 digits for the year. If the user enters 1999, great, but if the user enters 99 it is saved as 0099, not great. A better format 'might' be DD-MON-RRRR. Again it allows the user to enter 2 or 4 digits for the year. If the user enters 4 digits, great again, but if the user enters 2 digits then 00 - 49 is saved internally as 2000 - 2049. 50 - 99 is saved internally as 1950 - 1999. This may or may not be accurate for you application, for instance entering 23 as a birth year intending 1923 but saving 2023.

To enter the format into the WIN95/98/NT registry, run regedit. Expand HKEY_LOCAL_MACHINE then SOFTWARE. Right click Oracle, new, string value and call it NLS_DATE_FORMAT (if it does not already exist). Right click NLS_DATE_FORMAT, modify. Enter your chosen format DD-MON-YYYY or DD-MON- RRRR and that's it. The client will now display the date in that format.

There is a great article in Oracle Magazine January/February 1999 explaining all this and more.

Good luck.

Dan Webb
webbde_at_post.queensu.ca

In article <7qerqf$b2r$1_at_nnrp1.deja.com>,   charles_lin_at_computerhorizons.com wrote:
> Is any body know how to set date format in database to 4 digit year
> expression(dd-mmm-yy to dd-mmm-yyyy).
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Tue Aug 31 1999 - 14:45:15 CDT

Original text of this message

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