Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Date.prototype.getMilliseconds()

概述

getMilliseconds() 方法,根据本地时间,返回一个指定的日期对象的毫秒数。

语法

dateObj.getMilliseconds()

参数

描述

getMilliseconds() 方法返回一个0 到 999的整数。

例子

例子:使用getMilliseconds方法

下例中,将当前时间的毫秒数赋值给变量 ms

var ms;
Today = new Date();
ms = Today.getMilliseconds();

规范

规范版本 规范状态 注解
ECMAScript 1st Edition. Implemented in JavaScript 1.3 Standard Initial definition.
ECMAScript 5.1 (ECMA-262)
Date.prototype.getMilliseconds
Standard  
ECMAScript 6 (ECMA-262)
Date.prototype.getMilliseconds
Release Candidate  

浏览器兼容性

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) (Yes) (Yes) (Yes) (Yes)
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)

相关链接

 

文档标签和贡献者

 此页面的贡献者: teoli, AlexChao, ziyunfei
 最后编辑者: teoli,