Re: Capitalization of localized month and day names (to_char() with 'TMmonth', 'TMday', etc.)

From: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
To: Magnus Holmgren <magnus(dot)holmgren(at)millnet(dot)se>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Capitalization of localized month and day names (to_char() with 'TMmonth', 'TMday', etc.)
Date: 2021-10-06 12:17:34
Message-ID: CAC+AXB04GvuxTS7L0=P75nChcUgvy4MJu0jLxjK+JH2cpEB_HQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 6, 2021 at 11:09 AM Magnus Holmgren <magnus(dot)holmgren(at)millnet(dot)se>
wrote:

>
> There's just this tiny but seemingly obvious issue that I can't believe I
> haven't noticed until now: to_date(now(), 'TMmonth') returns 'october' in
> an
> English locale (en_US.UTF-8 at least). Names of months and weekdays are
> proper
> nouns and as such *always* capitalized in English, so that seems wrong to
> me.
>
> IMHO, the patterns of TO_CHAR() do as promised in the documentation [1]:

MONTH full upper case month name (blank-padded to 9 chars)
Month full capitalized month name (blank-padded to 9 chars)
month full lower case month name (blank-padded to 9 chars)

What you are proposing looks more like a new feature than a bug.

[1] https://www.postgresql.org/docs/current/functions-formatting.html

Regards,

Juan José Santamaría Flecha

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Maxim Orlov 2021-10-06 12:19:23 Re: Pre-allocating WAL files
Previous Message Daniel Gustafsson 2021-10-06 11:53:57 Re: More business with $Test::Builder::Level in the TAP tests