INSERT INTO tb_reader
(name,sex,barcode,vocation,birthday,
paperType,paperNO,tel,email,createDate,operator,re,typeid)
values
('asdf','男','sfdsdf','asdf',to_date('2009-04-06 16:55:11','yyyy-mm-dd hh:mi:ss'),'身份证','sdfasdf','asdfasdf','asdfasdf',to_date('2009-04-19 10:00:00','yyyy-mm-dd hh:mi:ss'),'zhou','asdfasdfasd',8);
这里提示小时值必须在 1-12 怎么解决啊?

解决方案 »

  1.   

    to_daTE 用 to_date('2004-05-07 13:23:44','yyyy-mm-dd hh24:mi:ss') 这种 HH24格式试试
      

  2.   

    hh24:mi:ss是输入24小时制的
      

  3.   

    你的时间类型的格式不正确,应该改成24小时格式的
    INSERT INTO tb_reader 
    (name,sex,barcode,vocation,birthday, 
    paperType,paperNO,tel,email,createDate,operator,re,typeid) 
    values 
    ('asdf','男','sfdsdf','asdf',to_date('2009-04-06 16:55:11','yyyy-mm-dd hh24:mi:ss')
      

  4.   

    开始混O版了  楼主请参考:日期和字符转换函数用法(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//