<script type="text/javascript">
window.onload = function(){
var nowDate = new Date();
var str = nowDate.getFullYear
()+"-"+(nowDate.getMonth() + 1)+"-"+nowDate.getDate()+"<br/>"+nowDate.getHours()+":"+nowDate.getMinutes()+":"+nowDate.getSeconds();
document.getElementById("time").innerHTML=str;//echo result to <i>
//var thisURL = document.URL;document.getElementById("weburl").value=thisURL;
}
</script>
<div class="headlines clearfix">
<span class="base"> <i id="time"> </i></span>
</div>
通过js获取到时间,通过innerHTML方法将获取到的时间插入到i标签中.当然技术强大的朋友还可以实现实时刷新.