| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Date/getSeconds | [Back] [Original] |
Get to know MDN better
This feature is well established and works across many devices and browser versions. Its been available across browsers since 20157.
Date getSeconds()
const moonLanding = new Date("July 20, 69 00:20:18");
console.log(moonLanding.getSeconds());
// 18
getSeconds()
seconds 30 Date xmas95
const xmas95 = new Date("1995-12-25T23:15:30");
const seconds = xmas95.getSeconds();
console.log(seconds); // 30
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-date.prototype.getseconds |
This page was last modified on 202585 by MDN contributors.
DategetDate()Date.prototype.getDay()getFullYear()Date.prototype.getHours()Date.prototype.getMilliseconds()Date.prototype.getMinutes()getMonth()Date.prototype.getSeconds()Date.prototype.getTime()getTimezoneOffset()getUTCDate()getUTCDay()getUTCFullYear()Date.prototype.getUTCHours()Date.prototype.getUTCMilliseconds()Date.prototype.getUTCMinutes()getUTCMonth()Date.prototype.getUTCSeconds()getYear()setDate()setFullYear()Date.prototype.setHours()setMilliseconds()setMinutes()setMonth()setSeconds()Date.prototype.setTime()setUTCDate()setUTCFullYear()Date.prototype.setUTCHours()setUTCMilliseconds()setUTCMinutes()setUTCMonth()setUTCSeconds()setYear()toDateString()toISOString()toJSON()toLocaleDateString()toLocaleString()toLocaleTimeString()toString()toTemporalInstant()toTimeString()toUTCString()valueOf()[Symbol.toPrimitive]()Object/FunctionYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |