有一些东西,需要记下来,为以后使用,这是一个js获得当前实时日期和时分秒星期的脚本:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript" type="text/javascript">
window.οnlοad=function getNowTime(){
//取得当前时间
var now= new Date();
var year=now.getFullYear();
var month=now.getMonth()+1;
var day=now.getDate();
var hour=now.getHours();
var minute=now.getMinutes();
var second=now.getSeconds();
var week=now.getDay();
var weekname="星期"+"天一二三四五六".split('')[week];
var nowdate=year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second+" "+weekname;
document.getElementById("break_date").value = nowdate;
window.setTimeout("getNowTime()",1000);
}
</script>
</head>
<body>
<input type="text" id="break_date" size="30"/>
</body>
</html>