返回 date 对象中用全球标准时间 (utc)表示的月份值。
dateobj.getutcmonth()
必选项 dateobj 参数为 date 对象。
说明
要获得用本地时间表示的月份,请使用 getmonth 方法。
getutcmonth 方法返回一个处于 0 到 11 之间的整数,这个整数就表示 date 对象中的月份值。所返回值并不等于按惯例来表示月份的数字。而是要比按惯例来表示月份的数字小 1。如果一个 date 对象中保存的值是"jan 5, 1996 08:47:00.0",那么 getutcmonth 将返回 0。
示例
下面这个例子说明了 getutcmonth 方法的用法。
function utcdatedemo(){ var d, s = "今天utc日期是: ";d = new date();s += (d.getutcmonth() + 1) + "/";s += d.getutcdate() + "/";s += d.getutcfullyear();return(s);}
闽公网安备 35060202000074号