Date.prototype.getUTCMonth()

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.

getUTCMonth() 는 지정된 날짜의 월을 0부터 시작하는 값 (0은 첫 해를 나타냄)으로 표준시에 따라 반환합니다.

Syntax

js
dateObj.getUTCMonth();

Return value

0부터 11까지의 정수로, 표준시에 따라 주어진 날짜의 달에 해당합니다. 1 월은 0, 2 월은 1, 3 월은 2 등입니다.

Examples

Using getUTCMonth()

다음 예제에서는 현재 날짜의 월 부분을 month 변수에 할당합니다.

js
var today = new Date();
var month = today.getUTCMonth();

명세

Specification
ECMAScript® 2025 Language Specification
# sec-date.prototype.getutcmonth

브라우저 호환성

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
getUTCMonth

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

See also