JS Built-ins
← Date76 / 120
DategetUTCDatebeginner

getUTCDate() β€” day 15

πŸ“– Usage Example
const d = new Date('2024-06-15T12:00:00.000Z')
d.getUTCDate()  // β†’ 15

Use getUTCDate() to retrieve the day of the month (1–31) in UTC, unaffected by the local timezone.

Date.prototype.getUTCDate()

Returns the day-of-month in UTC (1–31).

Challenge: Verify that new Date('2024-06-15T12:30:45.000Z').getUTCDate() returns 15.

πŸ’‘ Hints (1)
  • β€’ getUTCDate() is the UTC equivalent of getDate()