A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Date/getUTCSeconds below:

Date.prototype.getUTCSeconds() - JavaScript | MDN

Date.prototype.getUTCSeconds()

Baseline Widely available

getUTCSeconds() 方法以世界时为标准,返回一个指定的日期对象的秒数。

尝试一下
const moonLanding = new Date("July 20, 1969, 20:18:04 UTC");

console.log(moonLanding.getUTCSeconds());
// Expected output: 4
语法 参数

无。

返回值

getUTCSeconds() 返回一个 0 到 59 的整数。

示例 示例:使用 getUTCSeconds() 方法

下例将当前时间的秒数部分赋值给变量 seconds。

var today = new Date();
var seconds = today.getUTCSeconds();
规范 浏览器兼容性 参见

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4