[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth [Back]  [Original]

Date.prototype.getMonth() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Date.prototype.getMonth()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.

getMonth() Date . 0 .

In this article

const moonLanding = new Date("July 20, 69 00:20:18");

console.log(moonLanding.getMonth()); // (January gives 0)
// Expected output: 6

js
dateObj.getMonth();

0 11 . 0 1, 1 2... .

getMonth()

Date Xmas95 month 11 .

js
var Xmas95 = new Date("December 25, 1995 23:15:30");
var month = Xmas95.getMonth();

console.log(month); // 11

: : Intl.DateTimeFormat() options ("January" ) . .

js
var options = { month: "long" };
console.log(new Intl.DateTimeFormat("ko-KR", options).format(Xmas95));
// 12
console.log(new Intl.DateTimeFormat("en-US", options).format(Xmas95));
// December

Specification
ECMAScript 2027 LanguageSpecification
# sec-date.prototype.getmonth


Web Proxy Viewer  |  New URL  |  Original Page