JS Built-ins
← Date73 / 120
DategetUTCMonthbeginner

getUTCMonth() β€” December is 11

πŸ“– Usage Example
const d = new Date('2024-06-15T00:00:00.000Z')
d.getUTCMonth()  // β†’ 5 (June)
// 0=Jan, 11=Dec

Use getUTCMonth() to retrieve the zero-indexed UTC month (0 = January through 11 = December) of a Date.

Date.prototype.getUTCMonth()

December has UTC month index 11 (the maximum).

Challenge: Verify that new Date('2024-12-25T00:00:00.000Z').getUTCMonth() returns 11.

πŸ’‘ Hints (1)
  • β€’ December = 11 (0-indexed), the maximum month index