Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Simple Date/time question.
Force12 Solutions Ltd wrote:
>
> I understand you can have a combined date/time field in an Oracle
> table. Is this true? If so, what format should the values be entered in?
All columns of type DATE in Oracle include the time. When the time is not specified, it defaults to midnight, i.e. the first second of the day.
> I know the date goes in as '01-Jan-97'but I can't get a time to go in.
Typically you use a TO_DATE function to specify the time as well. The following statement, for example, would insert the following date and time: March 18, 1997 8:14am
INSERT INTO myTable (theDate)
VALUES ( TO_DATE('18-MAR-1997 08:14','DD-MON-YYYY HH24:MI') );
Remember people! The year 2000 is getting close! Get
used to using YYYY EVERYWHERE or you'll get burned.