課程
/前端開(kāi)發(fā)
/JavaScript
/JavaScript進(jìn)階篇
如何設(shè)置2017年10月1號(hào)應(yīng)該用setTime( )怎么寫
2017-07-31
源自:JavaScript進(jìn)階篇 7-3
正在回答
設(shè)置具體的一天:
var?time=new?Date("2017/9/13,12:19:33");
更正:
<html>
<body>
<script type="text/javascript">
var mydate = new Date();
mydate.setTime(mydate.getTime()+61*24*60*60*1000);
document.write(mydate);
</script>
</body>
</html>
date.setTime(mydate.getTime()+61*24*60*60*1000);
這個(gè)是用setFullYear()方法設(shè)置時(shí)間
var d = new Date()
d.setFullYear(2017,10,1);
document.write(d)
這個(gè)是用setTime()方法設(shè)置時(shí)間
var d = new Date();
document.write(d+"<br/>");
d.setTime(d.getTime()+61*24*60*60*1000);
丶Felix
香寶的夫差 提問(wèn)者 回復(fù) 丶Felix
舉報(bào)
本課程從如何插入JS代碼開(kāi)始,帶您進(jìn)入網(wǎng)頁(yè)動(dòng)態(tài)交互世界
2 回答nodeType的值是如何確定的???
2 回答如何恢復(fù)設(shè)置?
1 回答如何設(shè)置時(shí)間顯示
4 回答多個(gè)邏輯操作符的優(yōu)先級(jí)如何確定?
2 回答如何自由設(shè)置日期輸出的格式?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2017-08-02
設(shè)置具體的一天:
2017-07-31
更正:
<html>
<body>
<script type="text/javascript">
var mydate = new Date();
mydate.setTime(mydate.getTime()+61*24*60*60*1000);
document.write(mydate);
</script>
</body>
</html>
2017-07-31
<html>
<body>
<script type="text/javascript">
var mydate = new Date();
date.setTime(mydate.getTime()+61*24*60*60*1000);
document.write(mydate);
</script>
</body>
</html>
2017-07-31
這個(gè)是用setFullYear()方法設(shè)置時(shí)間
<html>
<body>
<script type="text/javascript">
var d = new Date()
d.setFullYear(2017,10,1);
document.write(d)
</script>
</body>
</html>
這個(gè)是用setTime()方法設(shè)置時(shí)間
<html>
<body>
<script type="text/javascript">
var d = new Date();
document.write(d+"<br/>");
d.setTime(d.getTime()+61*24*60*60*1000);
document.write(d)
</script>
</body>
</html>