ES6 - getUTCSeconds() 方法



JavaScript 的 `getUTCSeconds()` 方法根據世界標準時間返回指定日期中的秒數。`getUTCSeconds()` 返回的值是一個介於 0 和 59 之間的整數。

語法

Date.getUTCSeconds ()      

返回值

返回指定日期根據世界標準時間的秒數。

示例

var dt = new Date( "December 25, 1995 23:15:20" ); 
console.log("getUTCSeconds() : " + dt.getUTCSeconds());   

輸出

getUTCSeconds() : 20     
廣告
© . All rights reserved.