JavaScript Date.getSeconds()方法根据本地时间返回指定日期的秒数。getSeconds()返回的值是介于0和59之间的整数。
Date.getSeconds()
根据本地时间返回指定日期的秒数。
<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>
运行上面代码输出
链接:https://www.learnfk.comhttps://www.learnfk.com/javascript/date-getseconds.html
来源:LearnFk无涯教程网
getSeconds() : 20
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)