--- title: Date.prototype.getUTCDate() slug: Web/JavaScript/Reference/Global_Objects/Date/getUTCDate translation_of: Web/JavaScript/Reference/Global_Objects/Date/getUTCDate ---
getUTCDate()
方法以世界时为标准,返回一个指定的日期对象为一个月中的第几天
dateObj.getUTCDate()
无
getUTCDate()
返回一个 1 到 31 的整数值
getUTCDate()
方法下面的例子是把当前日期的天数部分赋值给变量 day
.
var today = new Date(); var day = today.getUTCDate();
规范版本 | 规范状态 | 注解 |
---|---|---|
ECMAScript 1st Edition. | Standard | Initial definition. Implemented in JavaScript 1.3. |
{{SpecName('ES5.1', '#sec-15.9.5.15', 'Date.prototype.getUTCDate')}} | {{Spec2('ES5.1')}} | |
{{SpecName('ES6', '#sec-date.prototype.getutcdate', 'Date.prototype.getUTCDate')}} | {{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.getUTCDate")}}