<script>
//setDate() 来设置当前月的某一天。 (1 ~ 31)
var d = new Date()
d.setDate(15)
console.log(d) //Mon Jul 15 2019 14:38:14 GMT+0800 (中国标准时间)
</script>
<script>
// 返回的是时间戳
console.log(new Date().setDate(15)) //1563172736342
</script>
<script>
// setMonth() 设置 Date 对象中月份 (0 ~ 11)。 d.setMonth(0) d.setMonth(0,20)
// setFullYear() 设置 Date 对象中的年份(四位数字)。 d.setFullYear(1992) d.setFullYear(1992,10,3)
//setHours() 设置 Date 对象中的小时 (0 ~ 23)。
//setMinutes() 设置 Date 对象中的分钟 (0 ~ 59)。
//setSeconds() 设置 Date 对象中的秒钟 (0 ~ 59)。
//setMilliseconds() 设置 Date 对象中的毫秒 (0 ~ 999)。s
</script>