JavaScript getSeconds () method
Examples
Returns the time in seconds according to local time:
var d = new Date();
var n = d.getSeconds();
var n = d.getSeconds();
n output:
try it"
Definition and Usage
getSeconds () method returns the time in seconds. The return value is an integer of 0 to 59.
Browser Support
All major browsers support getSeconds () method
grammar
Date.getSeconds()
return value
类型 | 描述 |
---|---|
Number | 返回值是 0 ~ 59 之间的一个整数。 |
technical details
JavaScript version: | 1.0 |
---|
More examples
Displays the current time
How getHours (), getMinutes () and getSeconds () to display the current time.