Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How do I insert date/time into a ORACLE date field?????? - new to ORACLE
Glynn Smith wrote:
> insert into fi_test(create_date) values ( x );
>
On most ORACLE severs the default date format is DD-MON-YY with no time information. What you need to do is use the TO_DATE(x, fmt) function when setting the date and TO_CHAR(create_Date, fmt) when retreiving the date if you want to use another format. Below I have shown some example formats for the dates specified
TO_DATE('1/20/1997 12:34:23', 'MM/DD/YYYY HH:MI:SS) TO_DATE('12-23-1996 14:35:34', 'MM-DD-YYY HH24:MI:SS) TO_DATE('1-JAN-97 12:45:43', 'DD-MON-YY HH:MI:SS)
Hope this helps
paul