日期:2014-05-17 浏览次数:20747 次
function clockon(bgclock){ var now=new Date(); var year=now.getYear(); var month=now.getMonth(); var date=now.getDate(); var day=now.getDay(); var hour=now.getHours(); var minu=now.getMinutes(); var sec=now.getSeconds(); var week; month=month+1; if(month<10) month="0"+month; if(date<10) date="0"+date; if(hour<10) hour="0"+hour; if(minu<10) minu="0"+minu; if(sec<10) sec="0"+sec; var arr_week=new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六"); week=arr_week[day]; var time=""; time=year+"年"+month+"月"+date+"日 "+week+" "+hour+":"+minu+":"+sec; if(document.all){ bgclock.innerHTML=time } var timer=setTimeout("clockon(bgclock)",200); } window.document.onLoad=clockon("bgclock");
------解决方案--------------------
直接取的话就是那样的多了个.0这与oracal有关。如果不要就处理一下咯。或者查询的sql写成这样
select to_char(yourtime,'yyyy-mm-dd HH24:mi:ss') from table
------解决方案--------------------