运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Dates</h1> <h2>The getUTCMonth() Method</h2> <p>getUTCMonth() returns the month (from 0 to 11) of a date, according to UTC.</p> <p id="demo"></p> <script> const d = new Date(); let month = d.getUTCMonth(); document.getElementById("demo").innerHTML = month; </script> </body> </html>