JavaScript中的getMilliseconds()方法使用详解
javascriptDate.getMilliseconds()方法按照本地时间返回指定日期的毫秒数。通过getMilliseconds返回的是一个介于0和999的值。
语法
Date.getMilliseconds()
下面是参数的详细信息:
- NA
返回值:
按照本地时间返回指定日期的毫秒数。
例子:
<html>
<head>
<title>JavaScriptgetMillisecondsMethod</title>
</head>
<body>
<scripttype="text/javascript">
vardt=newDate();
document.write("getMilliseconds():"+dt.getMilliseconds());
</script>
</body>
</html>
这将产生以下结果:
getMilliseconds():578