怎么把日期改成“08-JUL-2005 10:23:35 am”的格式

[复制链接]
查看11 | 回复5 | 2016-1-7 20:57:31 | 显示全部楼层 |阅读模式
我现在是2005-07-08 10:23:35的格式,我用的是oracle 9i for window
回复

使用道具 举报

千问 | 2016-1-7 20:57:31 | 显示全部楼层
alter session set nls_language=american;
alter session set nls_date_format='YYYY-mon-DD hh12:mi:ss am';

SQL> select sysdate from dual;
SYSDATE
--------------------------
2005-jul-08 11:30:48 am
SQL>
回复

使用道具 举报

千问 | 2016-1-7 20:57:31 | 显示全部楼层
I exec the two sentences in toad but it did not work.but in sqlplus it worked.
thanks again.
回复

使用道具 举报

千问 | 2016-1-7 20:57:31 | 显示全部楼层
toad configurate session autometically.
u can use to_char instead.
回复

使用道具 举报

千问 | 2016-1-7 20:57:31 | 显示全部楼层
yes to_char will help you including in sqlplus
回复

使用道具 举报

千问 | 2016-1-7 20:57:31 | 显示全部楼层
select to_char(sysdate,'dd-mon-yyyy hh12:mm:ss am') from dual
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行