getUTCMinutes 方法 (Date)

使用协调通用时间(UTC),获取Date对象中的分钟。

语法

dateObj.getUTCMinutes()

参数

必需的dateObj引用是Date对象。

返回值

返回介于0和59之间的整数。当时间小于小时之后的一分钟时,返回零。如果创建Date对象时,未指定时间,默认情况下UTC分钟值是0。然而,在其它时间中,它可能有所不同。

备注

若要获取用当地时间存储的分钟数,请使用getMinutes方法。

示例

下面的示例演示了getUTCMinutes方法的用法。

var date = new Date("1/1/2001");
document.write(date.getUTCMinutes());
document.write("<br/>");
date.setMinutes(5);
document.write(date.getUTCMinutes());
// Output:
// 0
// 5

必备条件

在以下文档模式中受支持:怪异模式、Internet Explorer 6标准模式、Internet Explorer 7标准模式、Internet Explorer 8标准模式、Internet Explorer 9标准模式、Internet Explorer 10标准模式、Internet Explorer 11标准模式。应用商店应用(Windows 8和Windows Phone 8.1)中也受支持。请参阅版本信息

Applies ToDate Object

如果你喜欢这篇文章,敬请给站长打赏↑

除特别注明外,本站所有文章均为本站站长原译,转载请注明出处。