getUTCMonth()
JavaScript日期getUTCMonth()方法根据通用时间返回指定日期中的月份。 getUTCMonth返回的值是0到11之间的整数,对应于月份。 1月为0,2月为1,3月为2,依此类推。
语法 (Syntax)
Date.getUTCMonth ()
返回值 (Return Value)
根据通用时间返回指定日期的月份。
例子 (Example)
var dt = new Date( "December 25, 1995 23:15:20" );
console.log("getUTCMonth() : " + dt.getUTCMonth() );
输出 (Output)
getUTCMonth() : 11