setUTCFullYear() 메서드는 지정된 날짜의 전체 연도를 표준시에 따라 설정합니다.
Syntax
dateObj.setUTCFullYear(yearValue[, monthValue[, dayValue]])
Parameters
yearValue
- 연도의 숫자 값을 지정하는 정수입니다 (예 : 1995).
monthValue
- 선택 과목. 1 월에서 12 월까지의 월을 나타내는 0에서 11 사이의 정수입니다.
dayValue
- 선택 과목. 한 달의 날짜를 나타내는 1 - 31 사이의 정수입니다. dayValue 매개 변수를 지정하는 경우 monthValue도 지정해야합니다.
Return value
1970 년 1 월 1 일 00:00:00 UTC와 업데이트 된 날짜 사이의 밀리 초 숫자입니다.
Description
monthValue 및 dayValue 매개 변수를 지정하지 않으면 getUTCMonth()
및 getUTCDate()
메소드가 사용됩니다.
지정한 매개 변수가 예상 범위를 벗어난 경우 setUTCFullYear ()는 다른 매개 변수와 Date
객체의 날짜 정보를 그에 따라 업데이트하려고 시도합니다. 예를 들어, monthValue에 15를 지정하면 연도가 1 (yearValue + 1)만큼 증가하고 3은 해당 월에 사용됩니다.
Examples
Using setUTCFullYear()
var theBigDay = new Date();
theBigDay.setUTCFullYear(1997);
Specifications
Specification | Status | Comment |
---|---|---|
ECMAScript 1st Edition (ECMA-262) | Standard | Initial definition. Implemented in JavaScript 1.3. |
ECMAScript 5.1 (ECMA-262) The definition of 'Date.prototype.setUTCFullYear' in that specification. |
Standard | |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Date.prototype.setUTCFullYear' in that specification. |
Standard | |
ECMAScript Latest Draft (ECMA-262) The definition of 'Date.prototype.setUTCFullYear' in that specification. |
Draft |
Browser compatibility
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
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) |