Date.prototype.getUTCSeconds()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2015å¹´7æ.
getUTCSeconds() 㯠Date ã¤ã³ã¹ã¿ã³ã¹ã®ã¡ã½ããã§ãåå®ä¸çæã«åºã¥ããæå®ãããæ¥æã®ãç§ããè¿ãã¾ãã
試ãã¦ã¿ã¾ããã
const moonLanding = new Date("July 20, 1969, 20:18:04 UTC");
console.log(moonLanding.getUTCSeconds());
// äºæ³ãããçµæ: 4
æ§æ
js
getUTCSeconds()
弿°
ãªãã
è¿å¤
æå®ãããæ¥æã®ãåå®ä¸çæã«åºã¥ããç§ãã表ã 0 ãã 59 ã¾ã§ã®æ´æ°ã§ããæ¥æãç¡å¹ãªå ´å㯠NaN ãè¿ãã¾ãã
ä¾
>getUTCSeconds() ã®ä½¿ç¨
次ã®ä¾ã¯ãç¾å¨æ¥æã®ãç§ãé¨ã夿° seconds ã«ä»£å
¥ãã¾ãã
js
const today = new Date();
const seconds = today.getUTCSeconds();
仿§æ¸
| Specification |
|---|
| ECMAScript® 2027 Language Specification> # sec-date.prototype.getutcseconds> |