Date.prototype.getUTCMinutes()

Date 实例的 getUTCMinutes() 方法根据世界时间返回该日期的分钟。

¥The getUTCMinutes() method of Date instances returns the minutes for this date according to universal time.

Try it

语法

¥Syntax

js
getUTCMinutes()

参数

¥Parameters

没有任何。

¥None.

返回值

¥Return value

0 到 59 之间的整数,表示根据通用时间给定日期的分钟。如果日期是 invalid,则返回 NaN

¥An integer, between 0 and 59, representing the minutes for the given date according to universal time. Returns NaN if the date is invalid.

示例

¥Examples

使用 getUTCMinutes()

¥Using getUTCMinutes()

以下示例将当前时间的分钟部分分配给变量 minutes

¥The following example assigns the minutes portion of the current time to the variable minutes.

js
const today = new Date();
const minutes = today.getUTCMinutes();

规范

Specification
ECMAScript Language Specification
# sec-date.prototype.getutcminutes

¥Specifications

浏览器兼容性

BCD tables only load in the browser

¥Browser compatibility

也可以看看