位置:首頁 > 軟件操作教程 > 編程開發(fā) > HTML > 問題詳情

html特效代碼 41. 日期減去天數(shù)等于第二個(gè)日期

提問人:劉團(tuán)圓發(fā)布時(shí)間:2020-11-02

<script language=Javascript> 

function cc(dd,dadd) 

//可以加上錯(cuò)誤處理 

var a = new Date(dd) 

a = a.valueOf() 

a = a - dadd * 24 * 60 * 60 * 1000 

a = new Date(a) 

alert(a.getFullYear() + "年" + (a.getMonth() + 1) + "月" + a.getDate() + "日") 

} cc("12/23/2002",2) 

</script>

繼續(xù)查找其他問題的答案?

相關(guān)視頻回答
回復(fù)(0)
返回頂部