JavaScript
-
语言参考
-
方法
- getMonth
返回
Date
对象中用
本地时间
表示的月份值
语法
DateObj
.getMonth()
DateObj
必填参数
Date
对象
说明
getMonth
方法返回一个处于 0 到 11 之间的整数,它代表
Date
对象中的月份值。其中 1 月返回值是 0,12 月的返回值是 11。
要获取用
全球标准时间 (UTC)
表示的月份值,请使用
getUTCMonth
方法。
版本(Version)
JScript 1.0+
IE 3.0+
ECMAScript 1.0+
JavaScript 1.0+
Netscape 2.0+
Navigator 2.0+
Opera 3.0+