日期:2014-05-18 浏览次数:20499 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script>
function abc()
{
var today=new Date();
var otherDay=new Date(today.getTime()-259200000);
document.getElementById("txt1").value=today.toLocaleString();
document.getElementById("txt2").value=otherDay.toLocaleString();
}
</script>
</head>
<body onload="abc()">
<input type="text" id="txt1"/>
<input type="text" id="txt2"/>
</body>
</html>