Date.prototype.setUTCDate()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
setUTCDate()
方法就是根据全球时间设置特定 date 对象的日期。
尝试一下
语法
dateObj.setUTCDate(dayValue)
参数
dayValue
-
一个 1-31 的整形数字,用来指定日期。
描述
示例
使用 setUTCDate()
js
var theBigDay = new Date();
theBigDay.setUTCDate(20);
规范
Specification |
---|
ECMAScript Language Specification # sec-date.prototype.setutcdate |
浏览器兼容性
BCD tables only load in the browser