function timeToMinutes(timeStr) {
var parts = timeStr.split(':');
return parseInt(parts[0], 10) * 60 + parseInt(parts[1], 10);
}
// 示例
var timeStr = "02:30";
var minutes = timeToMinutes(timeStr);
console.log(minutes); // 输出: 150
function timeToMinutes(timeStr) {
var parts = timeStr.split(':');
return parseInt(parts[0], 10) * 60 + parseInt(parts[1], 10);
}
// 示例
var timeStr = "02:30";
var minutes = timeToMinutes(timeStr);
console.log(minutes); // 输出: 150