On 2024-01-29 17:22, Thomas Morgan wrote:
When I issue following
SELECT to_char(now(), 'Hh24') Current_Hour;
I get:
current_hour
--------------
Hh24
(1 row)
Is this documented or it it a flaw. Should it be doing the format
case insensitive?
Although it is not explicitly stated, the format string must be case
sensitive. You can infer that from the following table:
https://www.postgresql.org/docs/15/functions-formatting.html#FUNCTIONS-FORMATTING-DATETIME-TABLE
Note the difference between "AM" and "am", or "MONTH" and "Month" and
"month". (To name just two examples.) Based on that, it should be
obvious that the pattern has to be interpreted in a case sensitive manner.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)