Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Y2K problem with sysdate
Deepa Dinendra <deepa_dinendra_at_psmfc.org> wrote in message
news:3873B780.83DC432B_at_psmfc.org...
> Hi,
> My Pro*c programs which were not having any problems with dates before
> 01-jan-2000 is failing where ever there is sysdate function call.
>
> I tried the following:
> today varchar[15];
>
> EXEC SQL select sysdate into :today from dual;
> printf("Today is %s \n", today.arr);
>
> The result I obtained is
> Today is 05-JAN-015:20
>
> Only day and month +time is shown, NO year since it is 00. Has anybody
> experienced problems with sysdate since 2000?
>
It is showing the year! You just have no space between the year (0) and the
hours (15).
I would recommend always using TO_CHAR and specify the date format you want,
rather than relying on whatever happens to be the current default date to
char conversion. Then you can specify whatever format you need, and your
program will behave the same way even if the default date format is changed.
I would also recommend testing for Y2K problems before the year 2000 arrives
;)
Phil. Received on Tue Jan 11 2000 - 05:27:58 CST