<input type="text" id="showtime" value="" />
<script type="text/javascript">
function ymdhis(){
var obj = new Date();
var y = obj.getFullYear();
var m = obj.getMonth()+1;
var d = obj.getDate();
var h = obj.getHours();
var i = obj.getMinutes();
var s = obj.getSeconds();
if(m<10)m="0"+m;
if(d<10)d="0"+d;
if(h<10)h="0"+h;
if(i<10)i="0"+i;
if(s<10)s="0"+s;
var time = y+'-'+m+'-'+d+' '+h+':'+i+':'+s;
document.getElementById("showtime").value=time;
setTimeout(ymdhis,1000);
}
ymdhis();
</script>