Date.prototype.setUTCSeconds()
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ì.
setUTCSeconds() ë©ìëë íì¤ìì ë°ë¼ ì§ì ë ë ì§ì ì´ë¥¼ ì¤ì í©ëë¤.
ìëí´ ë³´ê¸°
const date1 = new Date("December 31, 1975, 23:15:30 GMT+11:00");
console.log(date1.getUTCSeconds());
// Expected output: 30
date1.setUTCSeconds(39);
console.log(date1.getUTCSeconds());
// Expected output: 39
구문
setUTCSeconds(secondsValue)
setUTCSeconds(secondsValue, msValue)
매ê°ë³ì
secondsValue-
ì´ë¥¼ ëíë´ë 0ìì 59 ì¬ì´ì ì ìì ëë¤.
msValue-
ì íì ì ë ¥ ê°. ë°ë¦¬ ì´ë¥¼ ëíë´ë 0ìì 999 ì¬ì´ì ì«ìì ëë¤.
ë°íê°
1970ë 1ì 1ì¼ 00:00:00 UTCì ì ë°ì´í¸ ë ë ì§ ì¬ì´ì ë°ë¦¬ ì´ ì«ìì ëë¤.
ì¤ëª
msValue ë§¤ê° ë³ì를 ì§ì íì§ ìì¼ë©´ getUTCMilliseconds() ë©ìëìì ë°í ë ê°ì´ ì¬ì©ë©ëë¤.
ì§ì í ë§¤ê° ë³ìê° ìì ë²ì를 ë²ì´ëë©´ setUTCSeconds()ê° ê·¸ì ë°ë¼ Date ê°ì²´ì ë ì§ ì 보를 ì
ë°ì´í¸íë ¤ê³ ìëí©ëë¤. ì를 ë¤ì´, secondsValueì 100ì ì¬ì©íë©´ Date ê°ì²´ì ì ì¥ë ë¶ì´ 1ì© ì¦ê°íê³ 40ì´ ëì ì¬ì©ë©ëë¤.
ìì
>setUTCSeconds() ì¬ì©í기
var theBigDay = new Date();
theBigDay.setUTCSeconds(20);
ëª ì¸
| Specification |
|---|
| ECMAScript® 2027 Language Specification> # sec-date.prototype.setutcseconds> |