在JS中操作时间之getUTCMilliseconds()方法的使用


 javascript Date.getUTCMilliseconds()方法按照通用时间的返回指定日期的毫秒数。通过getUTCMilliseconds返回的值是在0和999之间的一个整数。
语法

Date.getUTCMilliseconds()

下面是参数的详细信息:

  •     NA

返回值:

返回按照通用时间指定日期的毫秒数。
例子:

下面的例子打印的当前时间变量hrs的毫秒部分。

<html>
<head>
<title>JavaScript getUTCMilliseconds Method</title>
</head>
<body>
<script type="text/javascript">
  var dt = new Date();
  document.write("getUTCMilliseconds() : " + dt.getUTCMilliseconds() ); 
</script>
</body>
</html>

这将产生以下结果为印度时区:

getUTCMilliseconds() : 453 


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3