教程 date-fns tutorial

getMinutes

返回给定日期的分钟部分。

javascript
import { getMinutes } from "date-fns";

// 示例日期
const date = new Date(2024, 0, 1, 12, 30, 45); // 2024年1月1日 12:30:45

// 获取日期的分钟部分
const minutes = getMinutes(date);

console.log("日期的分钟部分:", minutes);
// 日期的分钟部分:30