标准时间代码(年月日星期时分秒)
<span id="tmd"></span><script language="javascript">
function ss()
{
var today=new Date();//总
yy=today.getYear();//年
mm=today.getMonth();//月
dd=today.getDate();//日
aa=today.getDay();//星期
shi=today.getHours();
fen=today.getMinutes();
miao=today.getSeconds();
var fontcolor="#ff0000";
if (fen <=9 )
fen="0"+fen
if (aa == 0)tt="星期天";else
if (aa == 1)tt="星期一";else
if (aa == 2)tt="星期二";else
if (aa == 3)tt="星期三";else
if (aa == 4)tt="星期四";else
if (aa == 5)tt="星期五";else
if (aa == 6)tt="星期六";
var oo = '时间' + yy + '年' + mm + '月' + dd + '日' + tt + "" + shi + ":" + fen + ":" + miao;
document.getElementById("tmd").innerHTML=oo.fontcolor(fontcolor);
}
setInterval("ss()",1000);
//-->
</script>
页:
[1]