运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <h2>JavaScript Dates</h2> <p>setUTCMonth() method sets the month (according to UTC time) of a date object:</p> <p id="demo"></p> <p><b>Note:</b> 0=January, 1=February etc.</p> <script> const d = new Date(); d.setUTCMonth(4); document.getElementById("demo").innerHTML = d; </script> </body> </html>