--- title: Date.prototype.getUTCMilliseconds() slug: Web/JavaScript/Reference/Global_Objects/Date/getUTCMilliseconds translation_of: Web/JavaScript/Reference/Global_Objects/Date/getUTCMilliseconds ---
getUTCMilliseconds()
方法以世界时为标准,返回一个指定的日期对象的毫秒数。
dateObj.getUTCMilliseconds()
无。
getUTCMilliseconds()
返回一个 0 到 999 的整数。
getUTCMilliseconds()
方法下例将当前时间的毫秒部分赋值给变量 milliseconds
。
var today = new Date(); var milliseconds = today.getUTCMilliseconds();
规范版本 | 规范状态 | 注解 |
---|---|---|
ECMAScript 1st Edition. | Standard | Initial definition. Implemented in JavaScript 1.3. |
{{SpecName('ES5.1', '#sec-15.9.5.25', 'Date.prototype.getUTCMilliseconds')}} | {{Spec2('ES5.1')}} | |
{{SpecName('ES6', '#sec-date.prototype.getutcmilliseconds', 'Date.prototype.getUTCMilliseconds')}} | {{Spec2('ES6')}} |
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
{{Compat("javascript.builtins.Date.getUTCMilliseconds")}}