1

I have PgSQL 9.6 on Fedora 29. System and PgSQL is running with cs_CZ.UTF-8 locale. But when I use to_char(date, 'Day Dy') I get english day name.

#shell> echo $LANG
cs_CZ.utf8

#sql> show lc_time;
cs_CZ.UTF-8
#sql> select to_char(now()::date, 'Day Dy');
Monday    Mon
#sql> set lc_time to 'it_IT.utf8';
#sql> show lc_time;
it_IT.utf8
#sql> select to_char(now()::date, 'Day Dy');
Monday    Mon

Is there anything I can set to make it working?

Martin Edlman
  • 665
  • 7
  • 15
  • YOU’ve answered the question, but I might add that you don’t need `::date` in your sample. – Manngo Aug 18 '22 at 22:57

1 Answers1

3

I have missed the 'TM' modifier, so the correct format is

#sql> select to_char(now()::date, 'TMDay TMDy');
Pondělí Po
Martin Edlman
  • 665
  • 7
  • 15