The following bug has been logged on the website:
Bug reference: 18445
Logged by: Filipe Caldas
Email address: fcaldasdesou(at)bloomberg(dot)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