JS Built-ins
← Date46 / 120
DategetMinutesbeginner

getMinutes() β€” returns 30

πŸ“– Usage Example
const d = new Date(2024, 0, 15, 12, 30)
d.getMinutes()  // β†’ 30
// returns 0–59

Use getMinutes() to retrieve the minutes component (0–59) of a Date object in local time.

Date.prototype.getMinutes()

Returns the minutes (0–59) in local time.

Challenge: Verify that new Date(2024, 0, 15, 12, 30).getMinutes() returns 30.

πŸ’‘ Hints (1)
  • β€’ The 5th argument to the Date constructor is minutes (0–59)