Translation of interval

839 Views Asked by At

There is maybe a way to translate automatically interval as it's shown by postgresql (e.g. "1330 days 10:54:54.266684") to other languages? For instance using locales, or other settings or I have to use replace, e.g. regexp_replace((now()-t.another_date)::text, 'day','dzień')?

1

There are 1 best solutions below

0
On BEST ANSWER

I think no. sorry. day, month etc are field in type interval. it will be in English. like you don't expect use "vybrac" instead of select :) But you can have locale in time values, yes.

td=# set lc_time TO pl_PL;
SET
td=# SELECT to_char(to_timestamp (4::text, 'MM'), 'TMmon');
 to_char
---------
 kwi
(1 row)

So probably only option is replacing timestamp filealds values with polish names