Date.prototype.getUTCMinutes()
getUTCMinutes()
方法根據世界時回傳指定日期的分鐘數。
嘗試一下
語法
getUTCMinutes()
返回值
若 Date
物件為有效日期,則根據 UTC 時間回傳一個表示分鐘數、介於 0 至 59 之間的整數;若為無效日期,則回傳 Number.NaN()
(en-US)。
範例
使用 getUTCMinutes()
下列範例指派當前時間的分鐘至變數 minutes
。
const today = new Date();
const minutes = today.getUTCMinutes();
規範
Specification |
---|
ECMAScript Language Specification # sec-date.prototype.getutcminutes |
瀏覽器相容性
BCD tables only load in the browser