<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
//右边大写D
const date = new Date()
console.log(date.getMonth() + 1) // 返回当前月份
console.log(date.getDay()) // 0 星期日是0
</script>
</body>
</html>
02-日期对象方法
最新推荐文章于 2024-07-18 11:48:33 发布