Re: BUG #4539: to_char(to_timestamp('...','....')) returns the wrong result
В списке pgsql-bugs по дате отправления:
| От | Heikki Linnakangas |
|---|---|
| Тема | Re: BUG #4539: to_char(to_timestamp('...','....')) returns the wrong result |
| Дата | |
| Msg-id | 49252597.3000109@enterprisedb.com обсуждение исходный текст |
| Ответ на | BUG #4539: to_char(to_timestamp('...','....')) returns the wrong result ("Stuart Green" <stuart@greenfam.com>) |
| Список | pgsql-bugs |
Stuart Green wrote:
> select to_char(to_timestamp('2008-11-14 16:00:00','YYYY-MM-DD
> HH24:MM:SS'),'day');
>
> is returning monday as the day in all the dbase version I Have test, 8.2.11,
> 8.2.10, and 8.1.11
Use 'MI' instead of 'MM' for the minutes. to_timestamp is quite lenient,
and interpretes the 00 in what you meant to be the minutes field as
month number. As there is no month 0, it uses January.
to_timestamp is much stricter in the upcoming 8.4 release, and will
throw an error for that query:
postgres=# select to_char(to_timestamp('2008-11-14 16:00:00','YYYY-MM-DD
HH24:MM:SS'),'day');
ERROR: conflicting values for "MM" field in formatting string
DETAIL: This value contradicts a previous setting for the same field type.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера