日期对象(Date)操作 getMonth()方法

作用:返回表示月份的数字。
语法:dateObject.getMonth()
返回:返回值是 0(一月) 到 11(十二月) 之间的一个整数。 dateObject 的月份字段,使用本地时间。
注释:该方法总是结合一个 Date 对象来使用。
 

getMonth() 返回一个月中的某一天

var d=new Date()

    console.log(d.getMonth())

猜你喜欢

转载自blog.csdn.net/qq_33650655/article/details/91548071
今日推荐