PostgreSQL 日期函数输出为法语 [英] PostgreSQL dates function output to a french language

查看:58
本文介绍了PostgreSQL 日期函数输出为法语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将PostgreSQL日期函数的结果作为to_char输出到法语,例如输出:

How can I output the result of PostgreSQL dates function as to_char to french language, for example the output of:

select to_char(current_date, 'Day') ;

应该是(一天的法语名称):

should be (a french name for a day):

Mardi 

而不是一天的英语(例如 Monady)

instead of english of day (e.g. Monady)

推荐答案

您需要设置日期/时间的显示 (LC_TIME) 到法语,查询的不是 Day 而是本地化的 Day TMDay 使用 TM 前缀.

You would need to set the display of date/time (LC_TIME) to french, and to query not the Day but rather the localizable day TMDay using the TM prefix.

show LC_TIME;
SET LC_TIME = 'French';
select to_char(current_date, 'TMDay') ;
 to_char
---------
 Mardi
(1 row)

这篇关于PostgreSQL 日期函数输出为法语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆