Re: Q: Default month in TO_DATE
Date: Sat, 10 Jan 2009 17:54:51 -0800
On Sun, 11 Jan 2009, Maxim Demenko wrote:
> Malcolm Dew-Jones schrieb:
> > I don't see this in the TO_DATE documentation, and because it's January I
> > can't see how to test this to confirm.
> > select to_date('2009','YYYY') from dual;
> > => shows 01-JAN-2009
> > The day is defaulting to 1, but what of the month?
> > - is the unspecified month defaulting to 1 (i.e. January)
> > - or is the unspecified month defaulting to the current month (which just
> > happens to be January because of when I ran the test).
> > Thanks for any feedback.
> DATE Datatype
> You use the DATE datatype to store fixed-length datetimes, which include
> the time of day in seconds since midnight. The date portion defaults to
> the first day of the current month; the time portion defaults to
> midnight. The date function SYSDATE returns the current date and time.
> So, if you query the same in february, you'll get 01-FEB-2009
I didn't think to look at the _data type_ documentation, I was looking at the conversion functions (TO_DATE from char). Received on Sat Jan 10 2009 - 19:54:51 CST