记录几天后的日期

演示:

脚本说明:
把如下代码加入<body>区域中
 <script language="JavaScript">
<!-- Begin
function AddDays(form) {
DaysToAdd=document.form.DaysToAdd.value;

var now=new Date();
var newdate=new Date();
var newtimems=newdate.getTime()+(DaysToAdd*24*60*60*1000);
newdate.setTime(newtimems);
document.form.display.value=newdate.toLocaleString();
}
// End -->
</script>
                    <form name=form>
                      <input type=text name=DaysToAdd size=4 value=10 onFocus="this.select()" onMouseOver="this.focus()">
                      <input type=button value="天后的日期将是.." onClick="AddDays(this.form)" name="button">
                      <input type=text name="display" size=20 value="">
                    </form>



Tags: ,山西晋城网站建设,晋城在线网页学习,晋城企业智能建站