Home » JavaScript Date getSeconds() Method

JavaScript Date getSeconds() Method

by Online Tutorials Library

JavaScript Date getSeconds() method

The JavaScript date getSeconds() method returns the seconds in the specified date on the basis of local time.

Syntax

The getSeconds() method is represented by the following syntax:

Return

An integer value between 0 and 59 that represents the second.

JavaScript Date getSeconds() method example

Here, we will understand getSeconds() method through various examples.

Example 1

Let’s see an example to print the value of current second.

Test it Now

Output:

56  

Example 2

Let’s see an example to print the value of seconds from the given date.

Test it Now

Output:

10  

Next TopicJavaScript Math

You may also like