Следите за новинками
в нашем Telegram канале. Жми, чтобы подписаться:)
138 of 264 menu
◀ ▶

setSeconds method

The setSeconds method allows you to change the number of seconds for the date object. It takes the number of seconds as the first parameter. It can also take milliseconds.

Syntax

date.setSeconds(seconds, [milliseconds]);

Example

Let's set the seconds for the current point in time:

let date = new Date(); date.setSeconds(59); console.log(date);

Example

Let's set the seconds and milliseconds for the current point in time:

let date = new Date(); date.setSeconds(59, 999); console.log(date);

See also

← →
↑
English▼
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline