Re: Problem with to_date function

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Problem with to_date function
Дата
Msg-id Pine.BSO.4.62.0508221511580.26056@leary.csoft.net
обсуждение исходный текст
Ответ на Problem with to_date function  (Gilberto C Andrade <gilbertoca@secad.to.gov.br>)
Список pgsql-jdbc

On Mon, 22 Aug 2005, Gilberto C Andrade wrote:

> I would like to know if the following is the expected result:
> from psql:
> bcoproducao=# select to_date(current_date, 'DD/MM/YYYY'), current_date;
> to_date   |    date
> ------------+------------
> 22/08/2005 | 22/08/2005
> (1 row)
>

This query depends on the setting of the DateStyle parameter which
determines how current_date is turned into text before being passed into
to_date.  The JDBC driver sets DateStyle to ISO on connection startup so
that it can send and receive dates in this format.  Unfortunately it seems
to_date doesn't error out with "improper date format" or similar, but just
tries to make a best guess at what you really wanted.

Kris Jurka

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Jan de Visser
Дата:
Сообщение: Re: Problem with to_date function
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Problem with to_date function