# 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

- the `setHours` method
  that sets the hours
- the `setMinutes` method
  that sets the minutes
- the `setSeconds` method
  that sets the seconds
- the `setMilliseconds` method
  that sets the milliseconds

← →
↑
en ru