javascript Date.getSeconds()方法按照本地時間在指定日期返回秒。通過getSeconds返回的值是0到59之間的一個整數。
語法
Date.getSeconds()
下麵是參數的詳細資訊:
-
NA
返回值:
按照本地時間返回在指定的日期的秒數。
例子:
<html>
<head>
<title>JavaScript getSeconds Method</title>
</head>
<body>
<script type="text/javascript">
var dt = new Date( "December 25, 1995 23:15:20" );
document.write("getSeconds() : " + dt.getSeconds() );
</script>
</body>
</html>
這將產生以下結果:
getSeconds() : 20
