FFIVE
oracle里没有convert函数,varchar2转date类型的话用to_date函数,date类型转字符串用to_char函数。to_date(String, 格式),返回值是date类型to_char(Date, 格式),返回值是字符串格式:Year:yy two digits 两位年 显示值:07yyy three digits 三位年 显示值:007yyyy four digits 四位年 显示值:2007Month:mm number 两位月 显示值:11mon abbreviated 字符集表示 显示值:11月,若是英文版,显示novmonth spelled out 字符集表示 显示值:11月,若是英文版,显示novemberDay:dd number 当月第几天 显示值:02ddd number 当年第几天 显示值:02dy abbreviated 当周第几天简写 显示值:星期五,若是英文版,显示friday spelled out 当周第几天全写 显示值:星期五,若是英文版,显示fridayddspth spelled out, ordinal twelfthHour:hh two digits 12小时进制 显示值:01hh24 two digits 24小时进制 显示值:13Minute:mi two digits 60进制 显示值:45Second:ss two digits 60进制 显示值:25其它Q digit 季度 显示值:4WW digit 当年第几周 显示值:44W digit 当月第几周 显示值:124小时格式下时间范围为: 0:00:00 - 23:59:59....12小时格式下时间范围为: 1:00:00 - 12:59:59 ....1. 日期和字符转换函数用法(to_date,to_char)select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') as nowTime from dual; //日期转化为字符串select to_char(sysdate,'yyyy') as nowYear from dual; //获取时间的年select to_char(sysdate,'mm') as nowMonth from dual; //获取时间的月select to_char(sysdate,'dd') as nowDay from dual; //获取时间的日select to_char(sysdate,'hh24') as nowHour from dual; //获取时间的时select to_char(sysdate,'mi') as nowMinute from dual; //获取时间的分select to_char(sysdate,'ss') as nowSecond from dual; //获取时间的秒select to_date('2004-05-07 13:23:44','yyyy-mm-dd hh24:mi:ss') from dual//