The base date as a Date object or timestamp (number)
The minutes as a number (0-59), or NaN if invalid
// Get minutes from Date object
const result = getMinutes(new Date(2025, 0, 15, 14, 30, 45));
// Returns: 30
// Get minutes from timestamp
const result2 = getMinutes(1704067200000); // 2024-01-01 00:00:00
// Returns: 0
// Minutes at the end of an hour
const result3 = getMinutes(new Date(2024, 11, 31, 23, 59, 59));
// Returns: 59
// Minutes at the start of an hour
const result4 = getMinutes(new Date(2024, 5, 15, 8, 0, 0));
// Returns: 0
// Invalid date returns NaN
const result5 = getMinutes(new Date("invalid"));
// Returns: NaN
Get the minutes of the given date.
This function validates arguments before processing and returns the minutes (0-59) of the given date. Returns NaN for invalid input.