Return the seconds, according to local time:
The result of n could be:
The getSeconds() method returns the seconds (from 0 to 59) of the specified date and time.
![]()
The getSeconds() method is supported in all major browsers.
| Type | Description |
|---|---|
| Number | A Number, from 0 to 59, representing the seconds |
| JavaScript Version: | 1.0 |
|---|
Display the time
How to use getHours(), getMinutes(), and getSeconds() to display the time.
JavaScript Date Object
Your message has been sent to W3Schools.