Re: BUG #1458: to_char is crazy
От | Alvaro Herrera |
---|---|
Тема | Re: BUG #1458: to_char is crazy |
Дата | |
Msg-id | 20050203054031.GA27145@dcc.uchile.cl обсуждение исходный текст |
Ответ на | BUG #1458: to_char is crazy ("Tomás Zandoná" <tdzandona@yahoo.com.br>) |
Список | pgsql-bugs |
On Wed, Feb 02, 2005 at 12:27:53AM +0000, Tomás Zandoná wrote: Hey Tomás, > I dont't know if it's a bug, but I insert the date 2005-10-09 in a Date > field. > Later I execute: > > select to_char(day, 'DD/MM/YYYY') from test_table; > > It returns 08/10/2005. > > ????? I don't understand why it returns 08 instead of 09... Is the column of type timestamp or something similar? If so, probably you are being bitten by a timezone problem. If you want just a date, declare the column with type date. -- Alvaro Herrera (<alvherre[@]dcc.uchile.cl>) Bob [Floyd] used to say that he was planning to get a Ph.D. by the "green stamp method," namely by saving envelopes addressed to him as 'Dr. Floyd'. After collecting 500 such letters, he mused, a university somewhere in Arizona would probably grant him a degree. (Don Knuth)
В списке pgsql-bugs по дате отправления: