Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle Date Format

Status
Not open for further replies.

agent

Technical User
Apr 12, 2002
4
GB
Hi,

I have a date passed to Oracle for example, '01/01/97' but when this is displayed as 'DD/MM/YYYY' it returns '01/01/2097' which is wrong.

I vaguely recall that there is a setting in the registry on windows which I can change but is there a setting in Oracle that I can change?

Thanks in advance,
agent
 
Hi !

Probably some convert-Problem. In which way have you sent it to the database ?
to_date("01/07/97","DD/MM/RR") or
to_date("01/07/97","DD/MM/YY")

Or there's just a stupid cheap low-cost Y2K-Workaround, that adds 100 to your year.

Greetings and hope you find the error

Bhahamut
 
HI,
If you must use 2 digit year formats use
'RR' to specify the year part..This adjusts for thr century..
Oracle stores all dates the same way..the format is only used to enter/display it..The init<sid>.ora can set the default format but the workstation's registry or environment
variable will override that setting
(In fact, if ANY NLS_ parameter is set on the workstation, ALL NLS_ parameters not set will revert to the default for that param, and for dates that is YY for the year part)

IMHO, it is better to specify the full 4 digit year as the database date format and/or set it at the workstation. That way you can avoid the Y3K problem. ( We will still have a Y10K issue to deal with, but it can wait)

[profile]

 

I have nls_date_format in the init.ora file set to DD/MM/RR
 
Hi, Then check the workstation's registry for NLS_ entries.
See my note about that issue.

[profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top