BUG #18445: date_part / extract range for hours do not match documentation

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #18445: date_part / extract range for hours do not match documentation
Дата
Msg-id 18445-2bdf6f3c730abe6d@postgresql.org
обсуждение исходный текст
Ответы Re: BUG #18445: date_part / extract range for hours do not match documentation
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18445
Logged by:          Filipe Caldas
Email address:      fcaldasdesou@bloomberg.net
PostgreSQL version: 14.11
Operating system:   Linux (RHEL 8)
Description:

In https://www.postgresql.org/docs/8.1/functions-datetime.html

We say that EXTRACT() should return a number between 0-23 for hours

hour
The hour field (0 - 23)
SELECT EXTRACT(HOUR FROM TIMESTAMP '2001-02-16 20:38:40');
Result: 20

The function seems to also return 24 in some cases eg:

SELECT date_part('hour', cast('24:00:00.00' as time))::int

Could we update the documentation or modify the function so that it wraps 24
back to 0 hours?
Thanks


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