Re: Date not being parsed as expected

Поиск
Список
Период
Сортировка
От Mario Weilguni
Тема Re: Date not being parsed as expected
Дата
Msg-id 200209070937.22775.mweilguni@sime.com
обсуждение исходный текст
Ответ на Date not being parsed as expected  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
Список pgsql-general
Am Freitag, 6. September 2002 09:24 schrieb Jean-Christian Imbeault:
> The following insert:
>
> insert into t values('01-10-29')
>
> gives the following result in the DB:
>
> select * from t
>       d
> ------------
>   2029-01-10
>
> Why is the first part (01) being parsed as the month? The DateStyle is
> set to ISO (the default) so shoudln't the parser see xx-yy-zz as being
> year-month-day?
>

You can easily avoid this when using to_date(), e.g.:
insert into t values (to_date('01-10-29', 'dd-mm-yy'))

(or whatever this date should be). It's a bit more work to write, however you'll be
on the safe side.

Regards,
    Mario Weilguni


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

Предыдущее
От: Jason Earl
Дата:
Сообщение: Re: Surprise :-(
Следующее
От: Joel Rodrigues
Дата:
Сообщение: Fwd: "...integer[] references..." = error