Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: to_date('01/01/97','dd/mm/yyyy')
In article <331CACB8.2781_at_garland.dnr.state.sc.us>,
<edwards_at_garland.dnr.state.sc.us> wrote:
>I have written an OCI text based data entry form.
>The problem is that too many people like to enter two digit
>years instead of four. How come oracle doesn't reject two
>digit years when I specify 4 digit years in the date picture??
>
>to_date('01/01/97','dd/mm/yyyy')
Oracle translates the above to 01-Jan-0097. Seems pretty dumb, but that's what they do. I'm not sure, but using 'dd/mm/rrrr' may work the way you want.
Nobody wants to enter the century. If they know that 97 means 1997, and that 00 means 2000, your program should, too. Write a routine to determine which they have entered, and infer the century from the 2-digit year.
I have a pl/sql function I have written just for that purpose. If you need it, I can dig it up.
Steve Cosner Received on Wed Mar 05 1997 - 00:00:00 CST
![]() |
![]() |