CodeLab
Show Output
 
xxxxxxxxxx
14
 
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
    <meta charset="utf-8">
5
    <title>JavaScript Specify the Date Value Outside of the Range</title>
6
</head>
7
<body>
8
    <script>
9
    var d = new Date(2018, 5, 24); // June 24, 2018
10
    d.setDate(36); // Sets day to 36, new date will be July 6, 2018
11
    document.write(d);
12
    </script>
13
</body>
14
</html>
 

在微博、微信、公众号、小程序分享此示例。 如果您觉得有帮助,请给我们一个赞。