oracle date

获取星期几:

select to_char(to_date('2010-08-05','yyyy-mm-dd'),'day') from dual; 

星期四

select to_char(to_date('2010-08-05','yyyy-mm-dd'),'day','NLS_DATE_LANGUAGE = American') from dual;

thursday

 

两个日期之间的天数:

select floor(sysdate - to_date('2010-08-05','yyyy-mm-dd')) from dual;

0

 

把日期置空

select 1, TO_DATE(null) from dual;   

 

to_char

select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') as nowTime from dual

 

to_date

to_date('2010-08-05','yyyy-mm-d

 

 

 

你可能感兴趣的:(sql)