<script language="
javascript">
//日期 
var now = new Date(); //获取系统日期,即Sat Jul 29 08:24:48 UTC+0800 2006 
var yy = now.getYear(); //截取年,即2006 
var mm = now.getMonth(); //截取月,即07 
var dd = now.getDay(); //截取日,即29 
//取时间 
var hh = now.getHours(); //截取小时,即8 
var mm = now.getMinutes(); //截取分钟,即34 
var ss = now.getTime() % 60000; //获取时间,因为系统中时间是以毫秒计算的, 
所以秒要通过余60000得到。 
ss = (ss - (ss % 1000)) / 1000; //然后,将得到的毫秒数再处理成秒 
var clock = hh+':'; //将得到的各个部分连接成一个日期时间 
if (mm < 10) clock += '0'; //字符串 
clock += mm+':';  
if (ss < 10) clock += '0';  
clock += ss; 
</script>