度量快速开发平台-专业、快速的软件定制快开平台
标题: Oracle日期显示为英文格式的方法 [打印本页]
作者: 万望 时间: 2020-5-6 22:13
标题: Oracle日期显示为英文格式的方法
国内用户在安装oracle的时候一般字符集设置的都是中文,那么日期查询显示的时候一般也默认的是中文格式的日期,如下图1所示:

如果想让2015-10月-21显示为2015-Oct-21这种英文格式,那么可以通过如下方法:
(1)连接到数据库后,设置当前session的字符集为英文,使用如下语句:
- ALTER SESSION SET NLS_DATE_LANGUAGE='AMERICAN';
复制代码这个设置只会在当前session生效,重新连接数据库则恢复默认。
(2)在需要显示为英文格式的地方做设置,如下图2所示:

我的需求是在跑报表的时候要求日期显示成英文格式,只是一个字段而已,所以我选用的是第二种方法,比较灵活。
作者: 陈晓龙 时间: 2020-5-7 14:48

作者: 陈晓龙 时间: 2020-5-7 14:49

作者: 陈晓龙 时间: 2020-5-7 14:49

作者: 万望 时间: 2020-5-7 22:08


作者: 万望 时间: 2020-5-7 22:09


作者: 万望 时间: 2020-5-7 22:11


作者: 万望 时间: 2020-5-7 22:12


作者: 陈晓龙 时间: 2020-5-8 13:40

欢迎光临 度量快速开发平台-专业、快速的软件定制快开平台 (http://plat.delit.cn/) |
Powered by Discuz! X3.2 |