日期:2014-05-17  浏览次数:20786 次

ORACLE的时间问题
--insert into student(name,birthday) values('her',to_date(sysdate,'dd-mon-yyyy hh24:mi:ss'));
select student_id,name,to_char(birthday,'yyyy-mon-dd hh:mi:ss') from student;



结果:

  3 you 0008-8月 -06 12:00:00
  4 he 0008-8月 -06 12:00:00
  5 her 0008-8月 -06 12:00:00
怎么2008变成0008啦? 还有后面的小时也不正确。 哪位高手能告诉我啊

------解决方案--------------------
to_date(sysdate,'dd-mon-yyyy hh24:mi:ss')
sysdate 本身就是date,干什么还要to_date?