oracle 时间

select to_char(to_date(sysdate,'yyyy-mm-dd'),'day') from dual;

select to_date('2017-12-31','day') from dual;

select sysdate,to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
select sysdate,to_char(sysdate,'yyyy-mm-dd hh:mi:ss') from dual;
select sysdate,to_char(sysdate,'yyyy-ddd hh:mi:ss') from dual;
select sysdate,to_char(sysdate,'yyyy-mm iw-d hh:mi:ss') from dual; select TO_CHAR(SYSDATE,'YYYYMMDD') res from dual; select TRUNC(LAST_DAY(SYSDATE))+1 res from dual; select TO_CHAR(TRUNC(sysdate) + 3,'YYYYMMDD') res from dual; select to_date('','yyyy') - to_date('','yyyy') from dual;
select to_date('','yyyy') - to_date('','yyyy') from dual;
select to_date('','yyyy') - to_date('','yyyy') from dual;
select to_date('','yyyy') - to_date('','yyyy') from dual;
select to_date('','yyyy') - to_date('','yyyy') from dual;
select to_date('','yyyy') - to_date('','yyyy') from dual;
select to_date(sysdate,'yyyy') - to_date(sysdate,'yyyy') -1 from dual; select ADD_MONTHS(trunc(sysdate,'yyyy'),12) from dual; select to_date(to_char(ADD_MONTHS(trunc(sysdate,'yyyy'),12)),'RRRR') from dual; select TO_CHAR(SYSDATE,'RRRR') + 1 from dual; select to_date(TO_CHAR(SYSDATE,'RRRR'),'yyyy') - to_date(TO_CHAR(SYSDATE,'RRRR')-1,'yyyy') from dual; select * from ADD_MONTHS(trunc(sysdate,'yyyy'),12)+2/24 from dual; select TO_CHAR('2017-12-29','DAY') from dual; --当前的年月日20171231
select TO_CHAR(TRUNC(sysdate) + 3,'YYYYMMDD') res from dual; select TO_CHAR(TRUNC(sysdate) + 3,'DS') res from dual; select to_char(to_date(TRUNC(sysdate),'yyyy-mm-dd'),'d') from dual; select to_char(to_date(TRUNC(sysdate),'yyyy-mm-dd'),'IW') from dual;
上一篇:【转】iPhone X


下一篇:linux中的查找命令